SSL_CLIENT_M_VERSION
X.509 version of the client
From fedora-directory-commits at redhat.com Tue Sep 5 19:57:57 2006
From: fedora-directory-commits at redhat.com (Robert Crittenden (rcritten))
Date: Tue, 5 Sep 2006 12:57:57 -0700
Subject: [Fedora-directory-commits] mod_revocator/docs - New directory
Message-ID: <200609051957.k85Jvvw1029134@cvs-int.fedora.redhat.com>
Author: rcritten
Update of /cvs/dirsec/mod_revocator/docs
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv29119/docs
Log Message:
Directory /cvs/dirsec/mod_revocator/docs added to the repository
From fedora-directory-commits at redhat.com Tue Sep 5 19:58:29 2006
From: fedora-directory-commits at redhat.com (Robert Crittenden (rcritten))
Date: Tue, 5 Sep 2006 12:58:29 -0700
Subject: [Fedora-directory-commits] mod_revocator/docs mod_revocator.html,
NONE, 1.1
Message-ID: <200609051958.k85JwTE6029208@cvs-int.fedora.redhat.com>
Author: rcritten
Update of /cvs/dirsec/mod_revocator/docs
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv29154
Added Files:
mod_revocator.html
Log Message:
HTML documentation for mod_revocator
--- NEW FILE mod_revocator.html ---
mod_revocator
mod_revocator
Table of Contents
Introduction
Building
Configuration Directives
Developer Information
Introduction
This Apache module lets the user configure remote Certificate
Revocation Lists (CRLs) to be downloaded and installed automatically on
a regular basis without restarting the server. This helps ensure that
the CRLs are kept up-to-date with minimal effort. The module can also
bring the server down if the CRL expires and a new one cannot be
obtained. This module requires that mod_nss
also be installed.
Building
Refer to the README file included with the distribution for the latest
information.
Package Requirements
To build this you'll need:
NSPR 4.4.1 or
higher
NSS
3.9.3 or higher
Mozilla LDAP
SDK 5.15 or higher
Apache development package(s)
mod_nss
mod_revocator will not work with earlier versions of NSS due to an API
change.
Option
Description
--with-apr-config
Use apr-config to determine the APR directory
--with-apxs=PATH
Path to apxs
--with-nspr=PATH
Netscape Portable Runtime (NSPR) directory
--with-nspr-inc=PATH
Netscape Portable Runtime (NSPR) include file directory
--with-nspr-lib=PATH
Netscape Portable Runtime (NSPR) library directory
--with-nss=PATH
Network Security Services (NSS) directory
--with-nss-inc=PATH
Network Security Services (NSS) include directory
--with-nss-lib=PATH
Network Security Services (NSS) library directory
--with-ldapsdk=PATH
LDAP SDK directory
--with-ldapsdk-inc=PATH
Mozilla LDAP SDK include directory
--with-ldapsdk-lib=PATH
Mozilla LDAP SDK library directory
The --with-nspr, --with-nss and --with-ldapsdk tags require that the
package be installed in the same parent directory (e.g. /opt/nspr,
/usr/local/nspr, etc). It will look in this parent for include/, lib/,
etc. Alternatively you can use -inc and -lib to specify separate
locations for each one (--with-nspr-inc, --with-nspr-lib,
--with-nss-inc, etc).
If --with-nss or --with-nspr and/or --with-ldapsdk are not passed
configure will look for the [nss|nspr|mozldap]-devel packages and use
the libraries with that if found.
A sample configure might look something like:
% ./configure --with-apxs[=/path/to/apxs/]
--with-nspr=/path/to/nspr/ --with-nss=/path/to/nss/
--with-ldapsdk=/path/to/ldapsdk
% gmake all install
You only need to use =/path/to/apxs if apxs isn't in your path or if
you want to install into a specific Apache installation.
This just installs the library librevocation.so. You will need to
manually install the Apache module at this point. A sample
configuration file is provided in revocator.conf.
NSPR and NSS are both included with Fedora Core 5 but it doesn't ship
the Mozilla LDAP SDK.
Configuration Directives
CRLEngine
This boolean turns on/off CRL revocation. This actives the automatic
CRL retrieval for this server.
CRLUpdateCritical
Shut down server if CRL updates fail (for example, if the remote URL is
not accessible).
CRLAgeCheck
Boolean that when enabled will shut down server if CRLs are too old.
The server will shut down if the age of a downloaded CRL exceeds the
time specified in its Next Update field. This condition indicates that
the CRL may not contain the most recent information available. To avoid
the possibility of users authenticating with compromised certificates
that would have been added to an up-to-date CRL, you can choose to have
the server shut down automatically when a CRL is considered too old.
This check is performed when the CRL is downloaded. Therefore, an
already downloaded CRL can become older than its Next Update time in
the interval between updates and still be considered valid. This
feature does not apply to CRLs that do not have a Next Update field.
CRLFile
A space-delimited list of protocol://urldata;update_interval;max_age If
multiple remote locations are listed then the value will need to be
enclosed in double-quotes.
urldata specifies the URL(s) of
remote CRLs to retrieve and install. mod_revocator can download CRLs
over HTTP, HTTP over SSL, LDAP, and LDAP over SSL. You can also specify
a binary executable to retrieve the data. This executable must return
the data via stdout. The executable option is primarily to work around
LDAP library resolution problem but any executable may be used. For
LDAP you may only retrieve one attribute. Valid URL formats are:
ldap[s]://hostname:port/base_dn?attributes?scope?filter
For example:
ldap://ldap.example.com:5000/o=example.net?usercertificate%3binary
telephoneNumber?sub?(sn=Jensen)??
http[s]://username:password at hostname:port/path[?query_string]
For example:
https://ca.example.com:1025/getCRL?op=getCRL&issuepoint=MasterCRL
exec://path/to/program|argument1|...|argumentn
For example:
exec:///opt/fortitude/bin/ldapget|ldap://ldap.example.com:3389/
o=example.com?userCertificate%3bbinary?sub?(uid=crl)??
The ldapget program is supplied to demonstrate how this works and to
provide LDAP/S support. The usage for ldapget is:
/path/to/ldapget [/path/to/certdatabase] ldap://...
update_interval specifies the
maximum amount of time in minutes to allow between CRL downloads.
At startup, mod_revocator downloads all CRLs configured for automatic
downloading. To determine the time of the next download, mod_revocator
uses this value or the time specified in the Next Update field of the
CRL, whichever is sooner. Not all CRLs have a Next Update field,
however, so you must specify an update interval for each CRL.
To determine an appropriate update interval, consider the network
connectivity and available bandwidth at your site and how often the CRL
is updated. If you it is critcal to have up-to-date revocation
information then OCSP is probably a better way to go.
max_age specifies the time in
minutes you want mod_revocator to wait past the time indicated in the
CRL's Next Update field before determining that the CRL is too old to
be valid.
To avoid unnecessary shutdowns it is recommended that you set this
value no lower than 5 minutes and take into account possible system
time differences between the server host and the CA's CRL download
server.
If you have not enabled the option CRLUpdateCritical
then
the value specified in this field has no impact. A good starting value
is 60 minutes.
A sample configuration might look like:
CRLEngine on
CRLFile http://somehost.example.com/MasterCRL.crl;60;60
CRLAgeCheck off
CRLUpdateCritical off
Developer Information
This module uses some internals from NSS. This is normally a big no-no
but there was no other way to get around it. As such a private copy of
some of the NSS include files can be found in the mozilla subdirectory.
If you use a version of NSS other than 3.9.3 then you should replace
the files in this directory with appropriate files from whatever
version you are using. NSS 3.9.3 introduced a new locking mechanism for
PKCS#11 modules. As such the CKFW interface changed slightly so the
nsprstub.cpp in this module will not work with previous versions of
NSS.
From fedora-directory-commits at redhat.com Thu Sep 7 20:57:23 2006
From: fedora-directory-commits at redhat.com (Robert Relyea (rrelyea))
Date: Thu, 7 Sep 2006 13:57:23 -0700
Subject: [Fedora-directory-commits] coolkey/src/coolkey machdep.cpp,1.2,1.3
Message-ID: <200609072057.k87KvNut016767@cvs-int.fedora.redhat.com>
Author: rrelyea
Update of /cvs/dirsec/coolkey/src/coolkey
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv16750
Modified Files:
machdep.cpp
Log Message:
create separate cache files for each user.
Set permissions so all users can share the directory.
Index: machdep.cpp
===================================================================
RCS file: /cvs/dirsec/coolkey/src/coolkey/machdep.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- machdep.cpp 13 Jul 2006 21:32:39 -0000 1.2
+++ machdep.cpp 7 Sep 2006 20:57:20 -0000 1.3
@@ -177,6 +177,7 @@
#define FULL_CLEANUP
#else
/* if we can't lock on open, don't use locking for now */
+#undef FULL_CLEANUP
#define O_EXLOCK 0
#endif
@@ -207,9 +208,11 @@
#ifdef FULL_CLEANUP
flock(fd,LOCK_EX);
unsigned long ref = --(*(unsigned long *)addr);
+#ifdef notdef
if (ref == 0) {
unlink(path);
}
+#endif
flock(fd, LOCK_UN);
#endif
munmap(addr,size+RESERVED_OFFSET);
@@ -228,6 +231,14 @@
SHMem::initSegment(const char *name, int size, bool &init)
{
bool needInit = true;
+ /* big enough to hold a uid_t value in decimal */
+ /* decimal digits = ceiling(log10(uid_t_max)); */
+ /* log10(uid_t_max) = log256(uid_t_max)/log256(10); */
+ /* log256(uid_t_max) = sizeof(uid_t); */
+ /* log10(256) just greater than .41 */
+ /* so decimal_digits = (sizeof(uid_t)*100 +40)/41 */
+#define UID_DIGITS (((sizeof(uid_t)*100)+40)/41)
+ char uid_str[UID_DIGITS+2]; /* 1 for '-', 1 for null */
init = 0;
SHMemData *shmemData = new SHMemData;
@@ -236,12 +247,13 @@
// from getSHMemAddr.
return NULL;
}
- int ret = mkdir (MEMSEGPATH, 0755);
+ int ret = mkdir (MEMSEGPATH, 0777);
if ((ret == -1) && (errno != EEXIST)) {
delete shmemData;
return NULL;
}
- shmemData->path = new char [sizeof(MEMSEGPATH)+strlen(name)+2];
+ /* 1 for the '/', one for the '-' and one for the null */
+ shmemData->path = new char [sizeof(MEMSEGPATH)+strlen(name)+UID_DIGITS+3];
if (shmemData->path == NULL) {
delete shmemData;
return NULL;
@@ -249,11 +261,19 @@
memcpy(shmemData->path,MEMSEGPATH, sizeof(MEMSEGPATH));
shmemData->path[sizeof(MEMSEGPATH)-1] = '/';
strcpy(&shmemData->path[sizeof(MEMSEGPATH)],name);
+
+ int mode = 0777;
+ if (strcmp(name,"token_names") != 0) {
+ /* each user gets his own uid array */
+ sprintf(uid_str, "-%u",getuid());
+ strcat(shmemData->path,uid_str);
+ mode = 0700;
+ }
shmemData->fd = open(shmemData->path,
- O_CREAT|O_RDWR|O_EXCL|O_APPEND|O_EXLOCK, 0700);
+ O_CREAT|O_RDWR|O_EXCL|O_APPEND|O_EXLOCK, mode);
if (shmemData->fd < 0) {
needInit = false;
- shmemData->fd = open(shmemData->path,O_RDWR|O_EXLOCK, 0700);
+ shmemData->fd = open(shmemData->path,O_RDWR|O_EXLOCK, mode);
} else {
char *buf;
int len = size+RESERVED_OFFSET;
From fedora-directory-commits at redhat.com Wed Sep 13 17:43:56 2006
From: fedora-directory-commits at redhat.com (Jack Magne (jmagne))
Date: Wed, 13 Sep 2006 10:43:56 -0700
Subject: [Fedora-directory-commits] esc Makefile,1.1.1.1,1.2
Message-ID: <200609131743.k8DHhu5i012483@cvs-int.fedora.redhat.com>
Author: jmagne
Update of /cvs/dirsec/esc
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12466
Modified Files:
Makefile
Log Message:
Cleanup unneeded code for importing NSS.
Index: Makefile
===================================================================
RCS file: /cvs/dirsec/esc/Makefile,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- Makefile 12 Jun 2006 23:39:49 -0000 1.1.1.1
+++ Makefile 13 Sep 2006 17:43:54 -0000 1.2
@@ -19,29 +19,6 @@
include $(CORE_DEPTH)/coreconf/config.mk
-all:: importnss
include $(CORE_DEPTH)/coreconf/rules.mk
-# only build the card applet on Windows, and if the tools are setup
-
-ifeq ($(findstring WIN,$(OS_TARGET)),WIN)
-ifneq (,$(JAVACARD_KIT_DIR))
-ifneq (,$(JAVA_HOME))
-ifneq (,$(SLB_DIR))
-DIRS += applet
-endif
-endif
-endif
-endif
-
-# import xulrunner to get the gdk
-
-
-IMPORTS += src/xulrunner/v1.8.0.1/xulrunner-1.8.0.1-source.tar.gz
-importnss:
-ifeq ($(IMPORT_NSS),1)
-ifneq ($(wildcard $(NSSDIR)/$(OBJDIR)/include/prtypes.h),$(NSSDIR)/$(OBJDIR)/include/prtypes.h)
- $(MAKE) import
-endif
-endif
From fedora-directory-commits at redhat.com Wed Sep 13 17:44:54 2006
From: fedora-directory-commits at redhat.com (Jack Magne (jmagne))
Date: Wed, 13 Sep 2006 10:44:54 -0700
Subject: [Fedora-directory-commits] esc manifest.mn,1.1.1.1,1.2
Message-ID: <200609131744.k8DHisDl012518@cvs-int.fedora.redhat.com>
Author: jmagne
Update of /cvs/dirsec/esc
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12501
Modified Files:
manifest.mn
Log Message:
Remove uneeded code to import NSS.
Index: manifest.mn
===================================================================
RCS file: /cvs/dirsec/esc/manifest.mn,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- manifest.mn 12 Jun 2006 23:39:49 -0000 1.1.1.1
+++ manifest.mn 13 Sep 2006 17:44:51 -0000 1.2
@@ -15,21 +15,11 @@
# All rights reserved.
# END COPYRIGHT BLOCK
-CORE_DEPTH = .
-
-REQUIRES = nss nspr
+CORE_DEPTH = ./
DIRS = coreconf \
- clib \
- zlib \
- pkcs11 \
- esc \
+ src \
$(NULL)
-# egate \
-# lib \
-# cmd \
-IMPORTS = nspr20/v4.4.1 \
- nss/NSS_3_9_3_RTM \
- $(NULL)
+IMPORTS = $(NULL)
From fedora-directory-commits at redhat.com Wed Sep 13 17:45:51 2006
From: fedora-directory-commits at redhat.com (Jack Magne (jmagne))
Date: Wed, 13 Sep 2006 10:45:51 -0700
Subject: [Fedora-directory-commits] esc/coreconf rules.mk,1.1.1.1,1.2
Message-ID: <200609131745.k8DHjpKM012553@cvs-int.fedora.redhat.com>
Author: jmagne
Update of /cvs/dirsec/esc/coreconf
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12536
Modified Files:
rules.mk
Log Message:
Minor cleanup.
Index: rules.mk
===================================================================
RCS file: /cvs/dirsec/esc/coreconf/rules.mk,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- rules.mk 12 Jun 2006 23:39:53 -0000 1.1.1.1
+++ rules.mk 13 Sep 2006 17:45:49 -0000 1.2
@@ -749,7 +749,7 @@
-include $(DEPENDENCIES)
-ifneq (,$(filter-out OpenVMS OS2 WIN%,$(OS_TARGET)))
+ifneq (,$(filter-out Linux OpenVMS OS2 WIN%,$(OS_TARGET)))
# Can't use sed because of its 4000-char line length limit, so resort to perl
.DEFAULT:
@perl -e ' \
From fedora-directory-commits at redhat.com Wed Sep 13 17:46:55 2006
From: fedora-directory-commits at redhat.com (Jack Magne (jmagne))
Date: Wed, 13 Sep 2006 10:46:55 -0700
Subject: [Fedora-directory-commits] esc/src Makefile, 1.1.1.1,
1.2 manifest.mn, 1.1.1.1, 1.2
Message-ID: <200609131746.k8DHktHx012593@cvs-int.fedora.redhat.com>
Author: jmagne
Update of /cvs/dirsec/esc/src
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12574
Modified Files:
Makefile manifest.mn
Log Message:
Minor code cleanup.
Index: Makefile
===================================================================
RCS file: /cvs/dirsec/esc/src/Makefile,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- Makefile 12 Jun 2006 23:39:49 -0000 1.1.1.1
+++ Makefile 13 Sep 2006 17:46:53 -0000 1.2
@@ -23,14 +23,25 @@
ifeq ($(OS_ARCH), WINNT)
-DIRS += mozilla app/xpcom/tray app/xpcom win32
+DIRS += xulrunner app/xpcom/tray app/xpcom win32
endif
ifeq ($(OS_ARCH), Darwin)
-DIRS += mozilla app/xpcom/tray app/xpcom mac
+DIRS += xulrunner app/xpcom/tray app/xpcom mac
endif
ifeq ($(OS_ARCH), Linux)
-DIRS += mozilla lib/docklet app/xpcom/tray app/xpcom
+DIRS += xulrunner lib/notifytray app/xpcom/tray app/xpcom
+endif
+
+
+ifneq ($(OS_ARCH),Linux)
+IMPORTS += src/xulrunner/v1.8.0.1/xulrunner-1.8.0.1-source.tar.gz
+importnss:
+ifeq ($(IMPORT_NSS),1)
+ifneq ($(wildcard $(NSSDIR)/$(OBJDIR)/include/prtypes.h),$(NSSDIR)/$(OBJDIR)/include/prtypes.h)
+ $(MAKE) import
+endif
+endif
endif
Index: manifest.mn
===================================================================
RCS file: /cvs/dirsec/esc/src/manifest.mn,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- manifest.mn 12 Jun 2006 23:39:49 -0000 1.1.1.1
+++ manifest.mn 13 Sep 2006 17:46:53 -0000 1.2
@@ -15,7 +15,7 @@
# All rights reserved.
# END COPYRIGHT BLOCK
-CORE_DEPTH = ..
+CORE_DEPTH = ../
DIRS = \
lib/NssHttpClient \
From fedora-directory-commits at redhat.com Wed Sep 13 17:47:29 2006
From: fedora-directory-commits at redhat.com (Jack Magne (jmagne))
Date: Wed, 13 Sep 2006 10:47:29 -0700
Subject: [Fedora-directory-commits] esc/src/xulrunner - New directory
Message-ID: <200609131747.k8DHlTTa012619@cvs-int.fedora.redhat.com>
Author: jmagne
Update of /cvs/dirsec/esc/src/xulrunner
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12604/xulrunner
Log Message:
Directory /cvs/dirsec/esc/src/xulrunner added to the repository
From fedora-directory-commits at redhat.com Wed Sep 13 17:48:08 2006
From: fedora-directory-commits at redhat.com (Jack Magne (jmagne))
Date: Wed, 13 Sep 2006 10:48:08 -0700
Subject: [Fedora-directory-commits] esc/src/xulrunner Makefile,NONE,1.1
Message-ID: <200609131748.k8DHm8dN012646@cvs-int.fedora.redhat.com>
Author: jmagne
Update of /cvs/dirsec/esc/src/xulrunner
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12630
Added Files:
Makefile
Log Message:
Initial revision.
--- NEW FILE Makefile ---
#! 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
CORE_DEPTH = ../..
include $(CORE_DEPTH)/coreconf/config.mk
include $(CORE_DEPTH)/coreconf/rules.mk
#This just builds Xulrunner if necessary
TYPE=Debug
ifdef BUILD_OPT
TYPE=Release
endif
MOZ_SRCDIR=$(SOURCE_XP_DIR)/src/mozilla
MOZ_OBJDIR=$(DIST)/xulrunner_build
MOZ_RELOBJDIR=$(shell pwd)/$(MOZ_OBJDIR)
default: $(MOZ_OBJDIR)
#use the dependencies to know if we need to rebuild or not
export:: $(MOZ_OBJDIR)
lib:: $(MOZ_OBJDIR)
install:: $(MOZ_OBJDIR)
clean::
$(MOZ_OBJDIR): $(MOZ_SRCDIR)/.mozconfig $(MOZ_SRCDIR)/client.mk
(cd $(MOZ_SRCDIR) ; make -f client.mk build )
(cd $(MOZ_OBJDIR)/xulrunner/installer ; make )
touch $(MOZ_OBJDIR)
$(MOZ_SRCDIR)/.mozconfig: $(SOURCE_XP_DIR)/target.$(TYPE)
echo $@
rm -f $@
echo "mk_add_options MOZ_CO_PROJECT=xulrunner" > $@.$(TYPE)
echo "mk_add_options MOZ_OBJDIR=$(MOZ_RELOBJDIR)" >> $@.$(TYPE)
echo "ac_add_options --enable-application=xulrunner" >> $@.$(TYPE)
echo "ac_add_options --disable-tests" >> $@.$(TYPE)
echo "ac_cv_visibility_pragma=no" >> $@.$(TYPE)
ifdef BUILD_OPT
echo "ac_add_options --enable-optimize" >> $@.$(TYPE)
echo "ac_add_options --disable-debug" >> $@.$(TYPE)
else
echo "ac_add_options --disable-optimize" >> $@.$(TYPE)
echo "ac_add_options --enable-debug" >> $@.$(TYPE)
endif
ifeq ($(OS_ARCH),Linux)
echo "ac_add_options --disable-javaxpcom" >> $@.$(TYPE)
echo "ac_add_options --enable-default-toolkit=gtk2" >> $@.$(TYPE)
echo "ac_add_options --enable-xft" >> $@.$(TYPE)
echo "ac_add_options --disable-freetype2" >> $@.$(TYPE)
echo "ac_add_options --with-system-nspr" >> $@.$(TYPE)
echo "ac_add_options --with-system-nss" >> $@.$(TYPE)
endif
ifeq ($(OS_ARCH), WINNT)
echo "ac_add_options --disable-javaxpcom" >> $@.$(TYPE)
endif
cp $@.$(TYPE) $@
cat $@
#detect changes in .mozconfig and restart mozilla builds if necessary
# we can only do a debug or a release build at one time. if we
# try to run concurrent builds in the same tree, we will fail.
#NOTE: This also means we can't do multiple builds on different platforms
# at the same time in the mozilla tree
$(SOURCE_XP_DIR)/target.Debug:
rm -f $(SOURCE_XP_DIR)/target.Release # release is 'out of date' now
touch $(SOURCE_XP_DIR)/target.Debug
$(SOURCE_XP_DIR)/target.Release:
rm -f $(SOURCE_XP_DIR)/target.Debug # debug is 'out of date' now
touch $(SOURCE_XP_DIR)/target.Release
From fedora-directory-commits at redhat.com Wed Sep 13 17:49:43 2006
From: fedora-directory-commits at redhat.com (Jack Magne (jmagne))
Date: Wed, 13 Sep 2006 10:49:43 -0700
Subject: [Fedora-directory-commits] esc/src/app/xpcom/tray icon.png, NONE,
1.1
Message-ID: <200609131749.k8DHnhkb012688@cvs-int.fedora.redhat.com>
Author: jmagne
Update of /cvs/dirsec/esc/src/app/xpcom/tray
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12672
Added Files:
icon.png
Log Message:
Initial revision.
From fedora-directory-commits at redhat.com Wed Sep 13 17:50:15 2006
From: fedora-directory-commits at redhat.com (Jack Magne (jmagne))
Date: Wed, 13 Sep 2006 10:50:15 -0700
Subject: [Fedora-directory-commits]
esc/src/app/xpcom/tray Makefile, 1.1.1.1,
1.2 Makefile.in, 1.1.1.1, 1.2 Makefile.moz, 1.1.1.1,
1.2 rhITray.idl, 1.1.1.1, 1.2 rhITrayWindNotify.idl, 1.1.1.1,
1.2 rhLinuxTray.cpp, 1.1.1.1, 1.2 rhMacTray.cpp, 1.1.1.1,
1.2 rhTray.cpp, 1.1.1.1, 1.2 rhTray.h, 1.1.1.1, 1.2
Message-ID: <200609131750.k8DHoFVd012743@cvs-int.fedora.redhat.com>
Author: jmagne
Update of /cvs/dirsec/esc/src/app/xpcom/tray
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12696/tray
Modified Files:
Makefile Makefile.in Makefile.moz rhITray.idl
rhITrayWindNotify.idl rhLinuxTray.cpp rhMacTray.cpp rhTray.cpp
rhTray.h
Log Message:
Update to latest
Index: Makefile
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xpcom/tray/Makefile,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- Makefile 12 Jun 2006 23:39:50 -0000 1.1.1.1
+++ Makefile 13 Sep 2006 17:50:07 -0000 1.2
@@ -29,14 +29,18 @@
#MOZ_OBJDIR=$(MOZ_SRCDIR)
endif
+ifeq ($(OS_ARCH),Linux)
+endif
+
all export install clean deploy args::
echo "***** Dropping into the Mozilla build environment ***** $(MOZ_OBJDIR) $@"
+ echo $(DIST)
$(MAKE) -f Makefile.moz $@ \
OBJDIR=$(OBJDIR) \
CORE_DIST=$(DIST) \
CORE_INC=$(CORE_INC) \
MOZ_SRCDIR=$(MOZ_SRCDIR) \
- MOZ_OBJDIR=$(MOZ_OBJDIR)
+ MOZ_OBJDIR=$(MOZ_OBJDIR) \
libs::
@@ -45,13 +49,13 @@
CORE_DIST=$(DIST) \
CORE_INC=$(CORE_INC) \
MOZ_SRCDIR=$(MOZ_SRCDIR) \
- MOZ_OBJDIR=$(MOZ_OBJDIR)
+ MOZ_OBJ_DIR=$(MOZ_OBJDIR) \
$(MAKE) -f Makefile.moz deploy \
OBJDIR=$(OBJDIR) \
CORE_DIST=$(DIST) \
CORE_INC=$(CORE_INC) \
MOZ_SRCDIR=$(MOZ_SRCDIR) \
- MOZ_OBJDIR=$(MOZ_OBJDIR)
+ MOZ_OBJ_DIR=$(MOZ_OBJDIR)
Index: Makefile.in
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xpcom/tray/Makefile.in,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- Makefile.in 12 Jun 2006 23:39:50 -0000 1.1.1.1
+++ Makefile.in 13 Sep 2006 17:50:07 -0000 1.2
@@ -23,18 +23,39 @@
CORE_INC=$(SOURCE_XP_DIR)/public
MOZ_SRCDIR=$(SOURCE_XP_DIR)/src/mozilla
-MOZ_OBJDIR=$(DIST)/xulrunner_build/mozilla
+MOZ_OBJDIR=$(DIST)/xulrunner_build
ifeq ($(OS_ARCH), Darwin)
#MOZ_OBJDIR=$(MOZ_SRCDIR)
endif
-all export libs install clean args::
- echo "***** Dropping into the Mozilla build environment ***** $(MOZ_OBJDIR)"
+ifeq ($(OS_ARCH),Linux)
+endif
+
+all export install clean deploy args::
+ echo "***** Dropping into the Mozilla build environment ***** $(MOZ_OBJDIR) $@"
+ echo $(DIST)
$(MAKE) -f Makefile.moz $@ \
OBJDIR=$(OBJDIR) \
CORE_DIST=$(DIST) \
CORE_INC=$(CORE_INC) \
- MOZ_SRCDIR=$(MOZ_OBJDIR) \
- MOZ_OBJDIR=$(MOZ_OBJDIR)
+ MOZ_SRCDIR=$(MOZ_SRCDIR) \
+ MOZ_OBJDIR=$(MOZ_OBJDIR) \
+
+libs::
+
+ $(MAKE) -f Makefile.moz libs \
+ OBJDIR=$(OBJDIR) \
+ CORE_DIST=$(DIST) \
+ CORE_INC=$(CORE_INC) \
+ MOZ_SRCDIR=$(MOZ_SRCDIR) \
+ MOZ_OBJ_DIR=$(MOZ_OBJDIR) \
+
+ $(MAKE) -f Makefile.moz deploy \
+ OBJDIR=$(OBJDIR) \
+ CORE_DIST=$(DIST) \
+ CORE_INC=$(CORE_INC) \
+ MOZ_SRCDIR=$(MOZ_SRCDIR) \
+ MOZ_OBJ_DIR=$(MOZ_OBJDIR)
+
Index: Makefile.moz
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xpcom/tray/Makefile.moz,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- Makefile.moz 12 Jun 2006 23:39:50 -0000 1.1.1.1
+++ Makefile.moz 13 Sep 2006 17:50:07 -0000 1.2
@@ -28,12 +28,20 @@
MDDEPDIR := $(OBJDIR)/.deps
DESTDIR = $(MOZ_OBJDIR)/install
+NOTIFY_DEPTH = $(CORE_DEPTH)/src/lib/notifytray
+NOTIFY_CXX_FLAGS = -I$(NOTIFY_DEPTH) $(shell pkg-config --cflags glib-2.0)
+NOTIFY_LDFLAGS = $(shell pkg-config --libs libnotify)
+
+NO_DIST_INSTALL = 1
+ifeq ($(OS_ARCH),Linux)
+
+endif
-include $(MOZ_OBJDIR)/config/autoconf.mk
OS_CXXFLAGS += $(HOST_CXXFLAGS)
-MODULE = rhTray
+#MODULE = rhTray
XPIDL_MODULE = rhTray
LIBRARY_NAME = rhTray
@@ -44,13 +52,19 @@
RESFILE=cool.res
endif
+ifeq ($(OS_ARCH),Linux)
+
+COOLKEY_LIBS+= -L $(CORE_DIST)/lib -ltraynotify -L/usr/lib $(NOTIFY_LDFLAGS)
+
+endif
+
IS_COMPONENT = 1
MODULE_NAME = rhTray
# Ensure that the xpcom classes that we build
# do not export themselves
-DEFINES += -DXPCOM_GLUE $(GECKO_INCLUDES)
+DEFINES += -DXPCOM_GLUE $(GECKO_INCLUDES) -I./_xpidlgen
REQUIRES = string \
@@ -71,9 +85,8 @@
ifeq ($(OS_ARCH),Linux)
CPPSRCS = \
- rhLinuxTray.cpp \
- $(NULL)
-
+ rhLinuxTray.cpp \
+ $(NULL)
endif
ifeq ($(OS_ARCH),Darwin)
@@ -93,7 +106,7 @@
INSTALL_STUFF =
ifeq ($(OS_ARCH),Linux)
-INSTALL_STUFF += CoolKeyLogo.gif
+INSTALL_STUFF += icon.png
endif
ifeq ($(OS_ARCH),WINNT)
@@ -104,16 +117,14 @@
ifeq ($(OS_ARCH),Linux)
-
-CXXFLAGS += $(MOZ_GTK_CFLAGS) $(MOZ_GTK2_CFLAGS)
-
+CXXFLAGS += $(MOZ_GTK_CFLAGS) $(MOZ_GTK2_CFLAGS) $(NOTIFY_CXX_FLAGS)
endif
all:: export libs deploy
libs:: $(INSTALL_STUFF) rhTray.h
- $(NSINSTALL) rhTray.h $(DIST)/include/rhTray
+ $(NSINSTALL) rhTray.h $(CORE_INC)/rhTray
clean::
@@ -122,8 +133,8 @@
deploy::
echo "Deploying"
echo $(IMPORT_LIBRARY)
- $(NSINSTALL) ./$(LIB_PREFIX)rhTray$(DLL_SUFFIX) $(CORE_DEPTH)/esc/app/xul/esc/components
- $(NSINSTALL) ./_xpidlgen/*.xpt $(INSTALL_STUFF) $(CORE_DEPTH)/esc/app/xul/esc/components
+ $(NSINSTALL) ./$(LIB_PREFIX)rhTray$(DLL_SUFFIX) $(CORE_DEPTH)/src/app/xul/esc/components
+ $(NSINSTALL) ./_xpidlgen/*.xpt $(INSTALL_STUFF) $(CORE_DEPTH)/src/app/xul/esc/components
# separate libraries linked in.
Index: rhITray.idl
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xpcom/tray/rhITray.idl,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- rhITray.idl 12 Jun 2006 23:39:50 -0000 1.1.1.1
+++ rhITray.idl 13 Sep 2006 17:50:07 -0000 1.2
@@ -1,22 +1,5 @@
-/** 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 **/
-
#include "nsISupports.idl"
-
+#include "rhITrayWindNotify.idl"
interface nsIBaseWindow;
[scriptable,uuid(18100a23-0e0f-4201-8378-c9625d09be39)]
@@ -31,7 +14,16 @@
void hideall();
void showall();
boolean isInitializedAlready();
- void sendnotification(in string aMessage);
+ void sendnotification(in string aTitle, in string aMessage,in unsigned long aSeverity,in unsigned long aTimeout,in string aIcon);
+
+ void settooltipmsg(in string aMessage);
+ void seticonimage(in string aIcon);
+
+ void hideicon();
+ void showicon();
+
+ void setwindnotifycallback(in rhITrayWindNotify jsNotify);
+ void unsetwindnotifycallback(in rhITrayWindNotify jsNotify);
};
Index: rhITrayWindNotify.idl
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xpcom/tray/rhITrayWindNotify.idl,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- rhITrayWindNotify.idl 12 Jun 2006 23:39:50 -0000 1.1.1.1
+++ rhITrayWindNotify.idl 13 Sep 2006 17:50:07 -0000 1.2
@@ -1,20 +1,3 @@
-/** 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 **/
-
#include "nsISupports.idl"
Index: rhLinuxTray.cpp
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xpcom/tray/rhLinuxTray.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- rhLinuxTray.cpp 12 Jun 2006 23:39:50 -0000 1.1.1.1
+++ rhLinuxTray.cpp 13 Sep 2006 17:50:07 -0000 1.2
@@ -15,18 +15,23 @@
* All rights reserved.
* END COPYRIGHT BLOCK **/
+#define FORCE_PR_LOG 1
+
#include "rhTray.h"
#include "nsIGenericFactory.h"
#include
+#include "notifytray.h"
+#include "intl/nsIStringBundle.h"
NS_IMPL_ISUPPORTS1(rhTray, rhITray)
-
GtkWidget* rhTray::mWnd = NULL;
GtkWidget* rhTray::mIconMenu = NULL;
int rhTray::mInitialized = 0;
+std::list< nsCOMPtr > rhTray::gTrayWindNotifyListeners;
+
map< nsIBaseWindow *, rhTrayWindowListener *> rhTray::mWindowMap;
@@ -35,18 +40,45 @@
rhTray::rhTray()
{
/* member initializers and constructor code */
+
}
rhTray::~rhTray()
{
- PR_LOG( trayLog, 5, ("rhTray::~rhTray\n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::~rhTray\n"));
Cleanup();
/* destructor code */
}
+NS_IMETHODIMP rhTray::Setwindnotifycallback(rhITrayWindNotify *jsNotify)
+{
+
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Setwindnotifycallback\n"));
+
+ if(jsNotify)
+ AddTrayWindNotifyListener(jsNotify);
+
+
+ return NS_OK;
+
+}
+ /* void unsetwindnotifycallback (in rhITrayWindNotify jsNotify); */
+
+NS_IMETHODIMP rhTray::Unsetwindnotifycallback(rhITrayWindNotify *jsNotify)
+{
+
+
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Unsetwindnotifycallback\n"));
+
+ if(jsNotify)
+ RemoveTrayWindNotifyListener(jsNotify);
+
+ return NS_OK;
+}
+
/* void add (); */
NS_IMETHODIMP rhTray::Add(nsIBaseWindow *aWindow)
{
@@ -54,7 +86,7 @@
NS_ENSURE_ARG(aWindow);
- PR_LOG( trayLog, 5, ("rhTray::Add %p \n",aWindow));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Add %p \n",aWindow));
HRESULT res = Initialize();
if(res != S_OK)
{
@@ -72,7 +104,7 @@
/* void remove (); */
NS_IMETHODIMP rhTray::Remove(nsIBaseWindow *aWindow)
{
- PR_LOG( trayLog, 5, ("rhTray::Remove window %p \n",aWindow));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Remove window %p \n",aWindow));
if(!aWindow)
return NS_OK;
@@ -133,9 +165,11 @@
}
-NS_IMETHODIMP rhTray::Sendnotification(const char *aMessage)
+NS_IMETHODIMP rhTray::Sendnotification(const char *aTitle,const char *aMessage,PRUint32 aSeverity,PRUint32 aTimeout, const char *aIcon)
{
+ if(aMessage)
+ notify_icon_send_tooltip_msg(aTitle,aMessage,aSeverity,aTimeout,aIcon);
return NS_OK;
@@ -156,7 +190,42 @@
return NS_OK;
}
+/* void settooltipmsg (in string aMessage); */
+NS_IMETHODIMP rhTray::Settooltipmsg(const char *aMessage)
+{
+
+ if(aMessage)
+ notify_icon_set_static_tooltip(aMessage);
+
+ return NS_OK;
+}
+
+/* void seticonimage (in string aIcon); */
+NS_IMETHODIMP rhTray::Seticonimage(const char *aIcon)
+{
+
+
+ return NS_OK;
+}
+
+/* void hideicon (); */
+NS_IMETHODIMP rhTray::Hideicon(void)
+{
+
+ notify_icon_hide();
+
+ return NS_OK;
+}
+
+/* void showicon (); */
+NS_IMETHODIMP rhTray::Showicon(void)
+{
+
+ notify_icon_show();
+
+ return NS_OK;
+}
HRESULT rhTray::Initialize()
{
@@ -166,21 +235,32 @@
return S_OK;
}
- PR_LOG( trayLog, 5, ("rhTray::Initialize \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Initialize \n"));
g_set_print_handler(rhTray::TrayPrintHandler);
-
- HRESULT res = E_FAIL;
+
+ notify_icon_create_with_image_file(COOLKEY_ICON);
+
+ HRESULT res = notify_icon_created_ok();
if(res != S_OK)
{
return E_FAIL;
}
+
+ GtkWidget *icon_widget = notify_icon_get_box_widget();
+
+ if(icon_widget)
+ {
+ g_signal_connect(G_OBJECT(icon_widget), "button-press-event", G_CALLBACK(rhTray::IconCBProc), NULL);
+
+ }
+
res = CreateEventWindow();
- PR_LOG( trayLog, 5, ("rhTray::Initialize result of CreateIconMenu %d \n",res));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Initialize result of CreateIconMenu %d \n",res));
if(res != S_OK)
{
@@ -189,6 +269,8 @@
mInitialized = 1;
+ notify_icon_hide();
+
return S_OK;
}
@@ -199,7 +281,7 @@
HRESULT rhTray::Cleanup()
{
- PR_LOG( trayLog, 5, ("rhTray::Cleanup.\n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Cleanup.\n"));
RemoveAllListeners();
DestroyEventWindow();
@@ -211,7 +293,7 @@
void rhTray::ShowAllListeners()
{
- PR_LOG( trayLog, 5, ("rhTray::ShowAllListeners.\n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::ShowAllListeners.\n"));
map< nsIBaseWindow *, rhTrayWindowListener *>::iterator i;
rhTrayWindowListener *cur = NULL;
@@ -235,7 +317,7 @@
void rhTray::HideAllListeners()
{
- PR_LOG( trayLog, 5, ("rhTray::HideAllListeners.\n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::HideAllListeners.\n"));
map< nsIBaseWindow *, rhTrayWindowListener *>::iterator i;
@@ -258,7 +340,7 @@
HRESULT rhTray::DestroyEventWindow()
{
- PR_LOG( trayLog, 5, ("rhTray::DestroyEventWindow \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::DestroyEventWindow \n"));
rhTray::mWnd = 0;
@@ -268,7 +350,7 @@
void rhTray::IconMenuCBProc(GtkWidget *widget, gpointer data)
{
- PR_LOG( trayLog, 5, ("rhTray::IconMenuCBProc data %s \n",data));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::IconMenuCBProc data %s \n",data));
if(!strcmp((char *)data,"icon.min"))
@@ -278,6 +360,7 @@
if(!strcmp((char *)data,"icon.max"))
{
+ NotifyTrayWindListeners(MENU_EVT,MENU_SHOW);
rhTray::ShowAllListeners();
}
@@ -290,7 +373,7 @@
HRESULT rhTray::CreateIconMenu()
{
- PR_LOG( trayLog, 5, ("rhTray::CreateIconMenu \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::CreateIconMenu \n"));
if(mIconMenu)
return E_FAIL;
@@ -298,11 +381,11 @@
mIconMenu = gtk_menu_new ();
GtkWidget *min_item = gtk_menu_item_new_with_label ("Hide");
- GtkWidget *max_item = gtk_menu_item_new_with_label ("Show");
+ GtkWidget *max_item = gtk_menu_item_new_with_label ("Manage Keys");
GtkWidget *exit_item = gtk_menu_item_new_with_label ("Exit");
gtk_menu_shell_append (GTK_MENU_SHELL (mIconMenu), max_item);
- gtk_menu_shell_append (GTK_MENU_SHELL (mIconMenu), min_item);
+ //gtk_menu_shell_append (GTK_MENU_SHELL (mIconMenu), min_item);
gtk_menu_shell_append (GTK_MENU_SHELL (mIconMenu), exit_item);
g_signal_connect(G_OBJECT (min_item), "activate",
@@ -326,7 +409,7 @@
void rhTray::IconCBProc(GtkWidget *button, GdkEventButton *event, void *data)
{
- PR_LOG( trayLog, 5, ("rhTray::IconCBProc \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::IconCBProc \n"));
if(event->type != GDK_BUTTON_PRESS)
@@ -364,7 +447,7 @@
HRESULT rhTray::CreateEventWindow()
{
- PR_LOG( trayLog, 5, ("rhTray::CreateEventWindow \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::CreateEventWindow \n"));
HRESULT res = CreateIconMenu();
return res;
@@ -376,7 +459,7 @@
nsresult rv;
- PR_LOG( trayLog, 5, ("rhTray::AddListener %p \n",aWindow));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::AddListener %p \n",aWindow));
NS_ENSURE_ARG(aWindow);
nativeWindow aNativeWindow;
@@ -394,7 +477,7 @@
gdk_window_get_user_data (gWnd,(void **)&hWnd);
- PR_LOG(trayLog,5, ("rhTray::AddListener is widget %p .\n",hWnd));
+ PR_LOG(trayLog,PR_LOG_DEBUG, ("rhTray::AddListener is widget %p .\n",hWnd));
if(!hWnd)
{
return E_FAIL;
@@ -407,20 +490,20 @@
if(already)
{
- PR_LOG( trayLog, 5, ("rhTray::AddWindowListener Window already registered %p \n",aWindow));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::AddWindowListener Window already registered %p \n",aWindow));
return S_OK;
}
- PR_LOG( trayLog, 5, ("rhTray::AddWindowListener current level widget %p \n",hWnd));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::AddWindowListener current level widget %p \n",hWnd));
hWnd = gtk_widget_get_toplevel( hWnd);
- PR_LOG( trayLog, 5, ("rhTray::AddWindowListener top level widget %p \n",hWnd));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::AddWindowListener top level widget %p \n",hWnd));
if (GTK_WIDGET_TOPLEVEL (hWnd))
{
- PR_LOG( trayLog, 5, ("rhTray::AddWindowListener is really a top level widget %p \n",hWnd));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::AddWindowListener is really a top level widget %p \n",hWnd));
}
rhTrayWindowListener *create = new rhTrayWindowListener(hWnd);
@@ -450,7 +533,7 @@
HRESULT rhTray::RemoveListener(nsIBaseWindow *aBaseWindow)
{
- PR_LOG( trayLog, 5, ("rhTray::RemoveWindowListener %p \n",aBaseWindow));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::RemoveWindowListener %p \n",aBaseWindow));
if(!aBaseWindow)
return S_OK;
@@ -478,7 +561,7 @@
HRESULT rhTray::RemoveAllListeners()
{
- PR_LOG( trayLog, 5, ("rhTray::RemoveAllListenesr\n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::RemoveAllListenesr\n"));
map< nsIBaseWindow *, rhTrayWindowListener *>::iterator i;
rhTrayWindowListener *cur = NULL;
@@ -503,11 +586,109 @@
}
+//rhTrayWindNotify methods
+
+rhITrayWindNotify* rhTray::GetTrayWindNotifyListener(rhITrayWindNotify *listener)
+{
+
+ std::list >::const_iterator it;
+
+ for(it=gTrayWindNotifyListeners.begin(); it!=gTrayWindNotifyListeners.end(); ++it) {
+
+ if((*it) == listener)
+ {
+ return (*it);
+ }
+}
+
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhCoolKey::GetNotifyKeyListener: looking for %p returning NULL. \n",listener));
+
+ return nsnull;
+
+
+
+}
+
+int rhTray::GetTrayWindNotifyListSize()
+{
+ return gTrayWindNotifyListeners.size();
+
+}
+
+
+void rhTray::AddTrayWindNotifyListener(rhITrayWindNotify *listener)
+{
+
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::AddTrayWindNotifyListener: %p \n",
+listener));
+
+ if(GetTrayWindNotifyListener(listener ))
+ {
+
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::AddTrayWindNotifyListener: %p listener already in list. \n",listener));
+
+ return ;
+
+ }
+
+ gTrayWindNotifyListeners.push_back(listener);
+
+
+}
+
+void rhTray::RemoveTrayWindNotifyListener(rhITrayWindNotify *listener)
+{
+
+ if(!GetTrayWindNotifyListener(listener))
+ {
+ return;
+ }
+
+ gTrayWindNotifyListeners.remove(listener);
+
+
+ listener = NULL;
+}
+
+
+void rhTray::ClearTrayWindNotifyList()
+{
+
+ while (gTrayWindNotifyListeners.size() > 0) {
+ rhITrayWindNotify * node = (gTrayWindNotifyListeners.front()).get();
+
+ node = NULL;
+
+ gTrayWindNotifyListeners.pop_front();
+ }
+
+}
+
+void rhTray::NotifyTrayWindListeners(PRUint32 aEvent, PRUint32 aEventData,PRUint32 aKeyData,PRUint32 aData1, PRUint32 aData2)
+{
+
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::NotifyTrayWindListeners \n"));
+
+ //Now notify all the listeners of the event
+
+ std::list< nsCOMPtr >::const_iterator it;
+ for(it=gTrayWindNotifyListeners.begin(); it!=gTrayWindNotifyListeners.end(); ++it) {
+
+ PRBool claimed = 0;
+
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("NotifyTrayWindListeners about to notify \n"));
+ ((rhITrayWindNotify *) (*it))->RhTrayWindEventNotify(aEvent,aEventData, aKeyData, aData1, aData2, &claimed);
+
+
+ }
+
+}
+
void rhTray::TrayPrintHandler(const gchar *string)
{
- PR_LOG( trayLog, 5, ("rhTray:TrayPrintHandler. : %s \n",(char *) string));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray:TrayPrintHandler. : %s \n",(char *) string));
}
//rhTrayWindowListener Methods
@@ -519,12 +700,12 @@
rhTrayWindowListener::~rhTrayWindowListener()
{
- PR_LOG( trayLog, 5, ("rhTrayWindowListener::rhTrayWindowListener.\n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener::rhTrayWindowListener.\n"));
}
HRESULT rhTrayWindowListener::Initialize()
{
- PR_LOG( trayLog, 5, ("rhTrayWindowListener::Initialize \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener::Initialize \n"));
if(mWnd)
{
@@ -548,7 +729,7 @@
gtk_window_deiconify(GTK_WINDOW(mWnd));
- PR_LOG( trayLog, 5, ("rhTrayWindowListener:: ShowWindow \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener:: ShowWindow \n"));
}
}
@@ -558,7 +739,7 @@
if(mWnd)
{
gtk_widget_hide(mWnd);
- PR_LOG( trayLog, 5, ("rhTrayWindowListener:: Hide Window %p\n",mWnd));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener:: Hide Window %p\n",mWnd));
}
}
@@ -568,7 +749,7 @@
g_print("WndDestroyCBProc \n");
- PR_LOG( trayLog, 5, ("rhTrayWindowListener::WndDestroyCBProc \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener::WndDestroyCBProc \n"));
}
@@ -578,7 +759,7 @@
{
g_print("WndDeleteCBProc\n");
- PR_LOG( trayLog, 5, ("rhTrayWindowListener::WndDeleteCBProc \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener::WndDeleteCBProc \n"));
rhTrayWindowListener *me = (rhTrayWindowListener *) data;
Index: rhMacTray.cpp
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xpcom/tray/rhMacTray.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- rhMacTray.cpp 12 Jun 2006 23:39:50 -0000 1.1.1.1
+++ rhMacTray.cpp 13 Sep 2006 17:50:07 -0000 1.2
@@ -15,6 +15,8 @@
* All rights reserved.
* END COPYRIGHT BLOCK **/
+#define FORCE_PR_LOG 1
+
#include "rhTray.h"
#include "nsIGenericFactory.h"
#include
@@ -30,6 +32,8 @@
map< nsIBaseWindow *, rhTrayWindowListener *> rhTray::mWindowMap;
+std::list< nsCOMPtr > rhTray::gTrayWindNotifyListeners;
+
static PRLogModuleInfo *trayLog = PR_NewLogModule("tray");
rhTray::rhTray()
@@ -40,13 +44,39 @@
rhTray::~rhTray()
{
- PR_LOG( trayLog, 5, ("rhTray::~rhTray\n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::~rhTray\n"));
Cleanup();
/* destructor code */
}
+NS_IMETHODIMP rhTray::Setwindnotifycallback(rhITrayWindNotify *jsNotify)
+{
+
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Setwindnotifycallback\n"));
+
+ if(jsNotify)
+ AddTrayWindNotifyListener(jsNotify);
+
+
+ return NS_OK;
+
+}
+ /* void unsetwindnotifycallback (in rhITrayWindNotify jsNotify); */
+
+NS_IMETHODIMP rhTray::Unsetwindnotifycallback(rhITrayWindNotify *jsNotify)
+{
+
+
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Unsetwindnotifycallback\n"));
+
+ if(jsNotify)
+ RemoveTrayWindNotifyListener(jsNotify);
+
+ return NS_OK;
+}
+
/* void add (); */
NS_IMETHODIMP rhTray::Add(nsIBaseWindow *aWindow)
{
@@ -54,7 +84,7 @@
NS_ENSURE_ARG(aWindow);
- PR_LOG( trayLog, 5, ("rhTray::Add %p \n",aWindow));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Add %p \n",aWindow));
HRESULT res = Initialize();
if(res != S_OK)
@@ -73,7 +103,7 @@
/* void remove (); */
NS_IMETHODIMP rhTray::Remove(nsIBaseWindow *aWindow)
{
- PR_LOG( trayLog, 5, ("rhTray::Remove window %p \n",aWindow));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Remove window %p \n",aWindow));
if(!aWindow)
return NS_OK;
@@ -150,17 +180,46 @@
}
-NS_IMETHODIMP rhTray::Sendnotification(const char *aMessage)
+NS_IMETHODIMP rhTray::Sendnotification(const char *aTitle,const char *aMessage,PRUint32 aSeverity,PRUint32 aTimeout, const char *aIcon)
+{
+ return NS_OK;
+
+}
+
+/* void settooltipmsg (in string aMessage); */
+NS_IMETHODIMP rhTray::Settooltipmsg(const char *aMessage)
+{
+ return NS_OK;
+}
+
+/* void seticonimage (in string aIcon); */
+NS_IMETHODIMP rhTray::Seticonimage(const char *aIcon)
+{
+
+
+ return NS_OK;
+}
+
+/* void hideicon (); */
+NS_IMETHODIMP rhTray::Hideicon(void)
{
+
return NS_OK;
+}
+
+/* void showicon (); */
+NS_IMETHODIMP rhTray::Showicon(void)
+{
+
+ return NS_OK;
}
void rhTray::ShowApp()
{
- PR_LOG( trayLog, 5, ("rhTray::Show app! \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Show app! \n"));
::ShowHideProcess(&rhTray::mPSN,TRUE);
::SetFrontProcess(&rhTray::mPSN);
@@ -181,19 +240,19 @@
if(mInitialized)
return S_OK;
- PR_LOG( trayLog, 5, ("rhTray::Initialize dock: \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Initialize dock: \n"));
OSErr pRes = GetCurrentProcess (
&mPSN
);
- PR_LOG( trayLog, 5, ("rhTray::Initialize App PID result %d \n",pRes));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Initialize App PID result %d \n",pRes));
HRESULT res = CreateApplicationListener();
- PR_LOG( trayLog, 5, ("rhTray::Initialize result of CreateApplicationListener %d \n",res));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Initialize result of CreateApplicationListener %d \n",res));
if(res != S_OK)
{
@@ -207,7 +266,7 @@
HRESULT rhTray::RemoveIcon()
{
- PR_LOG( trayLog, 5, ("rhTray::RemoveIcon. \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::RemoveIcon. \n"));
@@ -216,7 +275,7 @@
HRESULT rhTray::Cleanup()
{
- PR_LOG( trayLog, 5, ("rhTray::Cleanup.\n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Cleanup.\n"));
RemoveAllListeners();
DestroyEventWindow();
@@ -244,7 +303,7 @@
if(!target)
return E_FAIL;
- PR_LOG( trayLog, 5, ("rhTray::CreateApplicationListener . app target %p\n",target));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::CreateApplicationListener . app target %p\n",target));
int numTypes = 4;
@@ -265,7 +324,7 @@
{
ShowApp();
- PR_LOG( trayLog, 5, ("rhTray::ShowAllListeners.\n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::ShowAllListeners.\n"));
map< nsIBaseWindow *, rhTrayWindowListener *>::iterator i;
rhTrayWindowListener *cur = NULL;
@@ -289,7 +348,7 @@
void rhTray::HideAllListeners()
{
- PR_LOG( trayLog, 5, ("rhTray::HideAllListeners.\n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::HideAllListeners.\n"));
map< nsIBaseWindow *, rhTrayWindowListener *>::iterator i;
@@ -313,7 +372,7 @@
HRESULT rhTray::DestroyEventWindow()
{
- PR_LOG( trayLog, 5, ("rhTray::DestroyEventWindow \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::DestroyEventWindow \n"));
return S_OK;
@@ -326,7 +385,7 @@
nsresult rv;
- PR_LOG( trayLog, 5, ("rhTray::AddListener %p \n",aWindow));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::AddListener %p \n",aWindow));
NS_ENSURE_ARG(aWindow);
nativeWindow aNativeWindow;
@@ -357,13 +416,13 @@
if(already)
{
- PR_LOG( trayLog, 5, ("rhTray::AddWindowListener Window already registered %p \n",aWindow));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::AddWindowListener Window already registered %p \n",aWindow));
return S_OK;
}
- PR_LOG( trayLog, 5, ("rhTray::AddWindowListener top level widget %p \n",hWnd));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::AddWindowListener top level widget %p \n",hWnd));
rhTrayWindowListener *create = new rhTrayWindowListener(hWnd);
@@ -391,7 +450,7 @@
HRESULT rhTray::RemoveListener(nsIBaseWindow *aBaseWindow)
{
- PR_LOG( trayLog, 5, ("rhTray::RemoveWindowListener %p \n",aBaseWindow));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::RemoveWindowListener %p \n",aBaseWindow));
if(!aBaseWindow)
return S_OK;
@@ -419,7 +478,7 @@
HRESULT rhTray::RemoveAllListeners()
{
- PR_LOG( trayLog, 5, ("rhTray::RemoveAllListenesr\n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::RemoveAllListenesr\n"));
map< nsIBaseWindow *, rhTrayWindowListener *>::iterator i;
rhTrayWindowListener *cur = NULL;
@@ -444,18 +503,111 @@
}
+//rhTrayWindNotify methods
+
+rhITrayWindNotify* rhTray::GetTrayWindNotifyListener(rhITrayWindNotify *listener)
+{
+
+ std::list >::const_iterator it;
+
+ for(it=gTrayWindNotifyListeners.begin(); it!=gTrayWindNotifyListeners.end(); ++it) {
+
+ if((*it) == listener)
+ {
+ return (*it);
+ }
+}
+
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhCoolKey::GetNotifyKeyListener: looking for %p returning NULL. \n",listener));
+
+ return nsnull;
+
+
+
+}
+
+int rhTray::GetTrayWindNotifyListSize()
+{
+ return gTrayWindNotifyListeners.size();
+
+}
+
+void rhTray::AddTrayWindNotifyListener(rhITrayWindNotify *listener)
+{
+
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::AddTrayWindNotifyListener: %p \n",
+listener));
+
+ if(GetTrayWindNotifyListener(listener ))
+ {
+
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::AddTrayWindNotifyListener: %p listener already in list. \n",listener));
+
+ return ;
+
+ }
+
+ gTrayWindNotifyListeners.push_back(listener);
+
+
+}
+
+void rhTray::RemoveTrayWindNotifyListener(rhITrayWindNotify *listener)
+{
+
+ if(!GetTrayWindNotifyListener(listener))
+ {
+ return;
+ }
+
+ gTrayWindNotifyListeners.remove(listener);
+
+
+ listener = NULL;
+}
+
+void rhTray::ClearTrayWindNotifyList()
+{
+
+ while (gTrayWindNotifyListeners.size() > 0) {
+ rhITrayWindNotify * node = (gTrayWindNotifyListeners.front()).get();
+
+ node = NULL;
+
+ gTrayWindNotifyListeners.pop_front();
+ }
+
+}
+
+void rhTray::NotifyTrayWindListeners(PRUint32 aEvent, PRUint32 aEventData,PRUint32 aKeyData,PRUint32 aData1, PRUint32 aData2)
+{
+
+ //Now notify all the listeners of the event
+
+ std::list< nsCOMPtr >::const_iterator it;
+ for(it=gTrayWindNotifyListeners.begin(); it!=gTrayWindNotifyListeners.end(); ++it) {
+
+ PRBool claimed = 0;
+
+ ((rhITrayWindNotify *) (*it))->RhTrayWindEventNotify(aEvent,aEventData, aKeyData, aData1, aData2, &claimed);
+
+
+ }
+
+}
+
pascal OSStatus rhTray::ApplicationProc(EventHandlerCallRef nextHandler, EventRef aEvent, void *userData)
{
OSStatus result = eventNotHandledErr;
- PR_LOG( trayLog, 5, ("rhTray::ApplicationProc .\n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::ApplicationProc .\n"));
int theEvent = GetEventKind(aEvent);
int theClass = GetEventClass(aEvent);
- PR_LOG( trayLog, 5, ("rhTray::ApplicationProc class %d event: %d \n",theClass,theEvent));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::ApplicationProc class %d event: %d \n",theClass,theEvent));
switch(theClass)
{
@@ -466,12 +618,12 @@
{
case kEventAppActivated:
- PR_LOG( trayLog, 5, ("rhTray::ApplicationProc App activated! \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::ApplicationProc App activated! \n"));
break;
case kEventAppDeactivated:
- PR_LOG( trayLog, 5, ("rhTray::ApplicationProc App deactivated! \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::ApplicationProc App deactivated! \n"));
result = noErr;
break;
@@ -482,7 +634,7 @@
case kEventClassCommand:
- PR_LOG( trayLog, 5, ("rhTray::ApplicationProc App kEventClassCommand! \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::ApplicationProc App kEventClassCommand! \n"));
HICommand commandStruct;
@@ -494,19 +646,19 @@
switch(commandStruct.commandID)
{
case kHICommandHide:
- PR_LOG( trayLog, 5, ("rhTray::ApplicationProc App kHICommandHide! \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::ApplicationProc App kHICommandHide! \n"));
break;
case kHICommandSelectWindow:
- PR_LOG( trayLog, 5, ("rhTray::ApplicationProc App kHICommandSelectWindow! \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::ApplicationProc App kHICommandSelectWindow! \n"));
break;
case kHICommandClose:
- PR_LOG( trayLog, 5, ("rhTray::ApplicationProc App kHICommandClose! \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::ApplicationProc App kHICommandClose! \n"));
break;
case kHICommandQuit:
- PR_LOG( trayLog, 5, ("rhTray::ApplicationProc App kHICommandQuit! \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::ApplicationProc App kHICommandQuit! \n"));
break;
};
@@ -532,14 +684,14 @@
rhTrayWindowListener::~rhTrayWindowListener()
{
- PR_LOG( trayLog, 5, ("rhTrayWindowListener::~rhTrayWindowListener.\n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener::~rhTrayWindowListener.\n"));
Cleanup();
}
HRESULT rhTrayWindowListener::Initialize()
{
- PR_LOG( trayLog, 5, ("rhTrayWindowListener::Initialize \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener::Initialize \n"));
mEventHandlerUPP = NewEventHandlerUPP(rhTrayWindowListener::WindowProc);
@@ -564,24 +716,24 @@
if(mWnd)
{
- PR_LOG( trayLog, 5, ("rhTrayWindowListener:: ShowWindow \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener:: ShowWindow \n"));
if(IsWindowCollapsed(mWnd))
{
- PR_LOG( trayLog, 5, ("rhTrayWindowListener:: ShowWindow : uncollapsing collapsed window. \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener:: ShowWindow : uncollapsing collapsed window. \n"));
::CollapseWindow(mWnd,FALSE);
}
if(!IsWindowVisible(mWnd))
{
- PR_LOG( trayLog, 5, ("rhTrayWindowListener:: ShowWindow : Window not visible showing... \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener:: ShowWindow : Window not visible showing... \n"));
::ShowWindow(mWnd);
}
//::BringToFront(mWnd);
- PR_LOG( trayLog, 5, ("rhTrayWindowListener:: ShowWindow : \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener:: ShowWindow : \n"));
rhTray::ShowApp();
@@ -593,7 +745,7 @@
if(mWnd)
{
- PR_LOG( trayLog, 5, ("rhTrayWindowListener:: HideWindow \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener:: HideWindow \n"));
//OSStatus res = ::CollapseWindow(mWnd,TRUE);
@@ -601,7 +753,7 @@
rhTray::HideApp();
- PR_LOG( trayLog, 5, ("rhTrayWindowListener:: HideWindow \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener:: HideWindow \n"));
}
@@ -616,13 +768,13 @@
int theEvent = GetEventKind(aEvent);
- PR_LOG( trayLog, 5, ("rhTrayWindowListener::WindowProc event: %d \n",theEvent));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener::WindowProc event: %d \n",theEvent));
switch(theEvent)
{
case kEventWindowClose:
- PR_LOG( trayLog, 5, ("rhTrayWindowListener::WindowProc attempting Window close! \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener::WindowProc attempting Window close! \n"));
if(self)
self->HideWindow();
@@ -631,17 +783,17 @@
case kEventWindowHidden:
- PR_LOG( trayLog, 5, ("rhTrayWindowListener::WindowProc attempting Window hide! \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener::WindowProc attempting Window hide! \n"));
break;
case kEventWindowClosed:
- PR_LOG( trayLog, 5, ("rhTrayWindowListener::WindowProc Window closed! \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener::WindowProc Window closed! \n"));
break;
case kEventMouseDown:
- PR_LOG( trayLog, 5, ("rhTrayWindowListener::WindowProc mouse down! \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener::WindowProc mouse down! \n"));
break;
}
@@ -652,7 +804,7 @@
HRESULT rhTrayWindowListener::Cleanup()
{
- PR_LOG( trayLog, 5, ("rhTrayWindowListener::Cleanup. \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener::Cleanup. \n"));
if(mEventHandlerRef)
{
Index: rhTray.cpp
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xpcom/tray/rhTray.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- rhTray.cpp 12 Jun 2006 23:39:50 -0000 1.1.1.1
+++ rhTray.cpp 13 Sep 2006 17:50:07 -0000 1.2
@@ -15,6 +15,8 @@
* All rights reserved.
* END COPYRIGHT BLOCK **/
+#define FORCE_PR_LOG 1
+
#include "rhTray.h"
#include "nsIGenericFactory.h"
#include
@@ -28,6 +30,8 @@
ATOM rhTray::mWndClass = 0;
+std::list< nsCOMPtr > rhTray::gTrayWindNotifyListeners;
+
map< nsIBaseWindow *, rhTrayWindowListener *> rhTray::mWindowMap;
NOTIFYICONDATA rhTray::mIconData;
@@ -50,13 +54,36 @@
rhTray::~rhTray()
{
- PR_LOG( trayLog, 5, ("rhTray::~rhTray\n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::~rhTray\n"));
Cleanup();
/* destructor code */
}
+NS_IMETHODIMP rhTray::Setwindnotifycallback(rhITrayWindNotify *jsNotify)
+{
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Setwindnotifycallback\n"));
+
+ if(jsNotify)
+ AddTrayWindNotifyListener(jsNotify);
+
+ return NS_OK;
+
+}
+ /* void unsetwindnotifycallback (in rhITrayWindNotify jsNotify); */
+
+NS_IMETHODIMP rhTray::Unsetwindnotifycallback(rhITrayWindNotify *jsNotify)
+{
+
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Unsetwindnotifycallback\n"));
+
+ if(jsNotify)
+ RemoveTrayWindNotifyListener(jsNotify);
+
+ return NS_OK;
+}
+
/* void add (); */
NS_IMETHODIMP rhTray::Add(nsIBaseWindow *aWindow)
{
@@ -64,7 +91,7 @@
NS_ENSURE_ARG(aWindow);
- PR_LOG( trayLog, 5, ("rhTray::Add %p \n",aWindow));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Add %p \n",aWindow));
HRESULT res = Initialize();
if(res != S_OK)
{
@@ -82,8 +109,7 @@
/* void remove (); */
NS_IMETHODIMP rhTray::Remove(nsIBaseWindow *aWindow)
{
- PR_LOG( trayLog, 5, ("rhTray::Remove window %p \n",aWindow));
-
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Remove window %p \n",aWindow));
return NS_OK;
}
@@ -150,7 +176,7 @@
return NS_OK;
}
-NS_IMETHODIMP rhTray::Sendnotification(const char *aMessage)
+NS_IMETHODIMP rhTray::Sendnotification(const char *aTitle,const char *aMessage,PRUint32 aSeverity,PRUint32 aTimeout, const char *aIcon)
{
if(aMessage)
@@ -163,6 +189,38 @@
}
+/* void settooltipmsg (in string aMessage); */
+NS_IMETHODIMP rhTray::Settooltipmsg(const char *aMessage)
+{
+ return NS_OK;
+}
+
+/* void seticonimage (in string aIcon); */
+NS_IMETHODIMP rhTray::Seticonimage(const char *aIcon)
+{
+
+
+ return NS_OK;
+}
+
+/* void hideicon (); */
+NS_IMETHODIMP rhTray::Hideicon(void)
+{
+
+
+ return NS_OK;
+}
+
+/* void showicon (); */
+NS_IMETHODIMP rhTray::Showicon(void)
+{
+
+
+ return NS_OK;
+}
+
+
+
HRESULT rhTray::SendBalloonTooltipMessage(char *aMessage)
{
@@ -189,9 +247,8 @@
return S_OK;
}
- PR_LOG( trayLog, 5, ("rhTray::Initialize \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Initialize \n"));
- //MessageBox(NULL,"Inside rhTray::Initialize!",NULL,NULL);
HRESULT res = CreateEventWindow();
@@ -227,7 +284,7 @@
rhTray::mIconData.uTimeout = 1000;
- PR_LOG(trayLog,5,("rhTray::Initialize tray icon handle %d \n",icon));
+ PR_LOG(trayLog,PR_LOG_DEBUG,("rhTray::Initialize tray icon handle %d \n",icon));
::Shell_NotifyIcon( NIM_ADD, &rhTray::mIconData);
@@ -238,7 +295,7 @@
HRESULT rhTray::RemoveIcon()
{
- PR_LOG( trayLog, 5, ("rhTray::RemoveIcon. \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::RemoveIcon. \n"));
::Shell_NotifyIcon(NIM_DELETE,&rhTray::mIconData);
@@ -248,7 +305,7 @@
HRESULT rhTray::Cleanup()
{
- PR_LOG( trayLog, 5, ("rhTray::Cleanup.\n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Cleanup.\n"));
RemoveAllListeners();
DestroyEventWindow();
@@ -260,7 +317,7 @@
void rhTray::ShowAllListeners()
{
- PR_LOG( trayLog, 5, ("rhTray::ShowAllListeners.\n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::ShowAllListeners.\n"));
map< nsIBaseWindow *, rhTrayWindowListener *>::iterator i;
rhTrayWindowListener *cur = NULL;
@@ -284,7 +341,7 @@
void rhTray::HideAllListeners()
{
- PR_LOG( trayLog, 5, ("rhTray::HideAllListeners.\n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::HideAllListeners.\n"));
map< nsIBaseWindow *, rhTrayWindowListener *>::iterator i;
@@ -307,7 +364,7 @@
HRESULT rhTray::DestroyEventWindow()
{
- PR_LOG( trayLog, 5, ("rhTray::DestroyEventWindow \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::DestroyEventWindow \n"));
::DestroyWindow(rhTray::mWnd);
rhTray::mWnd = 0;
@@ -318,7 +375,7 @@
HRESULT rhTray::CreateEventWindow()
{
- PR_LOG( trayLog, 5, ("rhTray::CreateEventWindow \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::CreateEventWindow \n"));
::SetLastError(0);
HINSTANCE hInst = ::GetModuleHandle(NULL);
@@ -388,13 +445,13 @@
{
case WM_LBUTTONDBLCLK:
- PR_LOG( trayLog, 5, ("rhTray::WindowProc: WM_LBUTTONDBLCLK \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::WindowProc: WM_LBUTTONDBLCLK \n"));
ShowAllListeners();
break;
case WM_RBUTTONDOWN:
- PR_LOG( trayLog, 5, ("rhTray::WindowProc: WM_RBUTTONDOWN \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::WindowProc: WM_RBUTTONDOWN \n"));
HRESULT res = rhTray::ShowPopupMenu (IDR_MENU1);
@@ -424,7 +481,7 @@
break;
case WM_CREATE:
- PR_LOG( trayLog, 5, ("rhTray::WindowProc: WM_CREATE \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::WindowProc: WM_CREATE \n"));
break;
default:
break;
@@ -444,7 +501,7 @@
nsresult rv;
- PR_LOG( trayLog, 5, ("rhTray::AddListener %p \n",aWindow));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::AddListener %p \n",aWindow));
NS_ENSURE_ARG(aWindow);
nativeWindow aNativeWindow;
@@ -470,7 +527,7 @@
if(already)
{
- PR_LOG( trayLog, 5, ("rhTray::AddWindowListener Window already registered %p \n",aWindow));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::AddWindowListener Window already registered %p \n",aWindow));
return S_OK;
}
@@ -502,7 +559,7 @@
hMenu = ::LoadMenu (::GetModuleHandle("rhTray.dll"),
MAKEINTRESOURCE (PopupMenuResource));
- PR_LOG( trayLog, 5, ("rhTray::ShowPopupMenu hMenu %d error %d\n",hMenu,GetLastError()));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::ShowPopupMenu hMenu %d error %d\n",hMenu,GetLastError()));
if (hMenu != 0) {
POINT pt;
@@ -526,7 +583,7 @@
HRESULT rhTray::RemoveListener(nsIBaseWindow *aBaseWindow)
{
- PR_LOG( trayLog, 5, ("rhTray::RemoveWindowListener %p \n",aBaseWindow));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::RemoveWindowListener %p \n",aBaseWindow));
if(!aBaseWindow)
return S_OK;
@@ -556,7 +613,7 @@
HRESULT rhTray::RemoveAllListeners()
{
- PR_LOG( trayLog, 5, ("rhTray::RemoveAllListenesr\n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::RemoveAllListenesr\n"));
map< nsIBaseWindow *, rhTrayWindowListener *>::iterator i;
rhTrayWindowListener *cur = NULL;
@@ -570,7 +627,7 @@
{
- PR_LOG( trayLog, 5, ("rhTray::RemoveAllListeners deleting %p\n",cur));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::RemoveAllListeners deleting %p\n",cur));
delete cur;
@@ -584,6 +641,96 @@
}
+//rhTrayWindNotify methods
+
+rhITrayWindNotify* rhTray::GetTrayWindNotifyListener(rhITrayWindNotify *listener)
+{
+
+ std::list >::const_iterator it;
+
+ for(it=gTrayWindNotifyListeners.begin(); it!=gTrayWindNotifyListeners.end(); ++it) {
+
+ if((*it) == listener)
+ {
+ return (*it);
+ }
+}
+
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhCoolKey::GetNotifyKeyListener: looking for %p returning NULL. \n",listener));
+
+ return nsnull;
+
+}
+
+int rhTray::GetTrayWindNotifyListSize()
+{
+ return gTrayWindNotifyListeners.size();
+
+}
+void rhTray::AddTrayWindNotifyListener(rhITrayWindNotify *listener)
+{
+
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::AddTrayWindNotifyListener: %p \n",
+listener));
+
+ if(GetTrayWindNotifyListener(listener ))
+ {
+
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::AddTrayWindNotifyListener: %p listener already in list. \n",listener));
+
+ return ;
+
+ }
+
+ gTrayWindNotifyListeners.push_back(listener);
+
+
+}
+
+void rhTray::RemoveTrayWindNotifyListener(rhITrayWindNotify *listener)
+{
+
+ if(!GetTrayWindNotifyListener(listener))
+ {
+ return;
+ }
+
+ gTrayWindNotifyListeners.remove(listener);
+
+
+ listener = NULL;
+}
+
+void rhTray::ClearTrayWindNotifyList()
+{
+
+ while (gTrayWindNotifyListeners.size() > 0) {
+ rhITrayWindNotify * node = (gTrayWindNotifyListeners.front()).get();
+
+ node = NULL;
+
+ gTrayWindNotifyListeners.pop_front();
+ }
+
+}
+
+void rhTray::NotifyTrayWindListeners(PRUint32 aEvent, PRUint32 aEventData,PRUint32 aKeyData,PRUint32 aData1, PRUint32 aData2)
+{
+
+ //Now notify all the listeners of the event
+
+ std::list< nsCOMPtr >::const_iterator it;
+ for(it=gTrayWindNotifyListeners.begin(); it!=gTrayWindNotifyListeners.end(); ++it) {
+
+ PRBool claimed = 0;
+
+ ((rhITrayWindNotify *) (*it))->RhTrayWindEventNotify(aEvent,aEventData, aKeyData, aData1, aData2, &claimed);
+
+
+ }
+
+}
+
//rhTrayWindowListener Methods
@@ -597,7 +744,7 @@
rhTrayWindowListener::~rhTrayWindowListener()
{
- PR_LOG( trayLog, 5, ("rhTrayWindowListener::~rhTrayWindowListener.\n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener::~rhTrayWindowListener.\n"));
Cleanup();
@@ -636,27 +783,25 @@
case WM_NCLBUTTONDOWN:
switch(wParam)
{
-
case HTMINBUTTON:
if(me)
{
me->HideWindow();
-
}
- PR_LOG( trayLog, 5, ("rhTrayWindowListener Minimize\n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener Minimize\n"));
eventClaimed = 1;
break;
case HTMAXBUTTON:
- PR_LOG( trayLog, 5, ("rhTrayWindowListener:: Maximize \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener:: Maximize \n"));
eventClaimed = 1;
break;
case HTCLOSE:
- PR_LOG( trayLog, 5, ("rhTrayWindowListener Close! \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener Close! \n"));
if(me)
{
@@ -677,7 +822,7 @@
case WA_ACTIVE:
case WA_CLICKACTIVE:
- PR_LOG( trayLog, 5, ("rhTrayWindowListener ACTIVATE! \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener ACTIVATE! \n"));
break;
@@ -701,7 +846,7 @@
}
- PR_LOG( trayLog, 5, ("rhTrayWindowListener WM_SHOWWINDOW wParam %d lParam %d! \n",wParam, lParam));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener WM_SHOWWINDOW wParam %d lParam %d! \n",wParam, lParam));
show = (int) wParam;
@@ -709,7 +854,7 @@
if(lParam == 0)
{
- PR_LOG( trayLog, 5, ("rhTrayWindowListener WM_SHOW called from ShowWindow or HideWindow \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener WM_SHOW called from ShowWindow or HideWindow \n"));
}
@@ -721,7 +866,7 @@
{
case SC_CLOSE:
- PR_LOG( trayLog, 5, ("rhTrayWindowListener:: WM_SYSCOMMAND SC_CLOSE \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener:: WM_SYSCOMMAND SC_CLOSE \n"));
break;
default:
@@ -735,7 +880,7 @@
{
case SIZE_MINIMIZED:
- PR_LOG( trayLog, 5, ("rhTrayWindowListener:: WM_SIZE SIZE_MINIMIZE \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener:: WM_SIZE SIZE_MINIMIZE \n"));
break;
default:
@@ -751,7 +896,7 @@
if(eventClaimed)
{
- PR_LOG( trayLog, 5, ("rhTrayWindowListener:: Event claimed \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener:: Event claimed \n"));
return FALSE;
}
@@ -766,7 +911,7 @@
HRESULT rhTrayWindowListener::Cleanup()
{
- PR_LOG( trayLog, 5, ("rhTrayWindowListener::Cleanup. \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener::Cleanup. \n"));
return S_OK;
@@ -790,7 +935,7 @@
{
if(mWnd)
{
- PR_LOG( trayLog, 5, ("rhTrayWindowListener:: ShowWindow \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener:: ShowWindow \n"));
::ShowWindow(mWnd,SW_SHOW);
::ShowWindow(mWnd,SW_RESTORE);
@@ -804,7 +949,7 @@
if(mWnd)
{
- PR_LOG( trayLog, 5, ("rhTrayWindowListener:: Hide Window \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener:: Hide Window \n"));
::ShowWindow(mWnd,SW_MINIMIZE);
::ShowWindow(mWnd,SW_HIDE);
Index: rhTray.h
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xpcom/tray/rhTray.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- rhTray.h 12 Jun 2006 23:39:50 -0000 1.1.1.1
+++ rhTray.h 13 Sep 2006 17:50:07 -0000 1.2
@@ -26,6 +26,20 @@
#include "widget/nsIBaseWindow.h"
#include "widget/nsIWidget.h"
+
+// Event Defines
+#define MENU_EVT 1
+#define APP_EVT 2
+#define WINDOW_EVT 3
+
+#define SHOW_ALL_WINDOWS 4
+#define HIDE_ALL_WINDOWS 5
+
+#define MENU_SHOW 6
+#define APP_SHOW 7
+
+
+
#ifdef XP_WIN32
#define _WIN32_IE 0x0500
@@ -46,8 +60,11 @@
#include
+extern "C" {
+#include "notifytray.h"
+}
-#define COOLKEY_ICON "components/CoolKeyLogo.gif"
+#define COOLKEY_ICON "components/icon.png"
#endif
#include
@@ -151,6 +168,20 @@
HRESULT DestroyEventWindow();
HRESULT RemoveIcon();
+
+ // rhTrayWindNotify content
+
+ static std::list< nsCOMPtr > gTrayWindNotifyListeners;
+
+
+ rhITrayWindNotify* GetTrayWindNotifyListener(rhITrayWindNotify *listener);
+
+ int GetTrayWindNotifyListSize();
+ void AddTrayWindNotifyListener(rhITrayWindNotify *listener);
+ void RemoveTrayWindNotifyListener(rhITrayWindNotify *listener);
+ void ClearTrayWindNotifyList();
+
+ static void NotifyTrayWindListeners(PRUint32 aEvent, PRUint32 aEventData =0,PRUint32 aKeyData=0, PRUint32 aData1=0, PRUint32 aData2=0);
};
#endif
@@ -240,6 +271,21 @@
//Gtk print handler
static void TrayPrintHandler(const gchar *string);
+
+
+ // rhTrayWindNotify content
+
+ static std::list< nsCOMPtr > gTrayWindNotifyListeners;
+
+
+ rhITrayWindNotify* GetTrayWindNotifyListener(rhITrayWindNotify *listener);
+
+ int GetTrayWindNotifyListSize();
+ void AddTrayWindNotifyListener(rhITrayWindNotify *listener);
+ void RemoveTrayWindNotifyListener(rhITrayWindNotify *listener);
+ void ClearTrayWindNotifyList();
+
+ static void NotifyTrayWindListeners(PRUint32 aEvent, PRUint32 aEventData =0,PRUint32 aKeyData=0, PRUint32 aData1=0, PRUint32 aData2=0);
};
#endif
@@ -331,6 +377,21 @@
HRESULT RemoveIcon();
+
+ // rhTrayWindNotify content
+
+ static std::list< nsCOMPtr > gTrayWindNotifyListeners;
+
+
+ rhITrayWindNotify* GetTrayWindNotifyListener(rhITrayWindNotify *listener);
+
+ int GetTrayWindNotifyListSize();
+ void AddTrayWindNotifyListener(rhITrayWindNotify *listener);
+ void RemoveTrayWindNotifyListener(rhITrayWindNotify *listener);
+ void ClearTrayWindNotifyList();
+
+ static void NotifyTrayWindListeners(PRUint32 aEvent, PRUint32 aEventData =0,PRUint32 aKeyData=0, PRUint32 aData1=0, PRUint32 aData2=0);
+
};
#endif
From fedora-directory-commits at redhat.com Wed Sep 13 17:50:09 2006
From: fedora-directory-commits at redhat.com (Jack Magne (jmagne))
Date: Wed, 13 Sep 2006 10:50:09 -0700
Subject: [Fedora-directory-commits]
esc/src/app/xpcom CoolKeyCSP.cpp, 1.1.1.1,
1.2 Makefile, 1.1.1.1, 1.2 Makefile.moz, 1.1.1.1,
1.2 rhCoolKey.cpp, 1.1.1.1, 1.2 rhICoolKey.idl, 1.1.1.1, 1.2
Message-ID: <200609131750.k8DHodWE012754@cvs-int.fedora.redhat.com>
Author: jmagne
Update of /cvs/dirsec/esc/src/app/xpcom
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12696
Modified Files:
CoolKeyCSP.cpp Makefile Makefile.moz rhCoolKey.cpp
rhICoolKey.idl
Log Message:
Update to latest
Index: CoolKeyCSP.cpp
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xpcom/CoolKeyCSP.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- CoolKeyCSP.cpp 12 Jun 2006 23:39:50 -0000 1.1.1.1
+++ CoolKeyCSP.cpp 13 Sep 2006 17:50:07 -0000 1.2
@@ -15,6 +15,8 @@
* All rights reserved.
* END COPYRIGHT BLOCK **/
+#define FORCE_PR_LOG 1
+
#include
#include
//#include
@@ -384,7 +386,7 @@
- PR_LOG( coolKeyCSPLog, 5, ("CoolKeyCSPListener::RhNotifyStateChange state %d \n",aKeyState));
+ PR_LOG( coolKeyCSPLog, PR_LOG_DEBUG, ("CoolKeyCSPListener::RhNotifyStateChange state %d \n",aKeyState));
AutoCoolKey key(aKeyType, aKeyID);
Index: Makefile
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xpcom/Makefile,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- Makefile 12 Jun 2006 23:39:50 -0000 1.1.1.1
+++ Makefile 13 Sep 2006 17:50:07 -0000 1.2
@@ -26,6 +26,9 @@
MOZ_SRCDIR=$(SOURCE_XP_DIR)/src/mozilla
MOZ_OBJDIR=$(DIST)/xulrunner_build
+ifeq ($(OS_ARCH),Linux)
+endif
+
all export install clean deploy args::
echo "***** Dropping into the Mozilla build environment ***** $(MOZ_OBJDIR)"
@@ -34,7 +37,8 @@
CORE_DIST=$(DIST) \
CORE_INC=$(CORE_INC) \
MOZ_SRCDIR=$(MOZ_SRCDIR) \
- MOZ_OBJDIR=$(MOZ_OBJDIR)
+ MOZ_OBJDIR=$(MOZ_OBJDIR) \
+
libs::
echo "***** Dropping into the Mozilla build environment ***** $(MOZ_OBJDIR)"
@@ -43,12 +47,14 @@
CORE_DIST=$(DIST) \
CORE_INC=$(CORE_INC) \
MOZ_SRCDIR=$(MOZ_SRCDIR) \
- MOZ_OBJDIR=$(MOZ_OBJDIR)
+ MOZ_OBJDIR=$(MOZ_OBJDIR) \
+
$(MAKE) -f Makefile.moz deploy \
OBJDIR=$(OBJDIR) \
CORE_DIST=$(DIST) \
CORE_INC=$(CORE_INC) \
MOZ_SRCDIR=$(MOZ_SRCDIR) \
- MOZ_OBJDIR=$(MOZ_OBJDIR)
+ MOZ_OBJDIR=$(MOZ_OBJDIR) \
+
Index: Makefile.moz
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xpcom/Makefile.moz,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- Makefile.moz 12 Jun 2006 23:39:49 -0000 1.1.1.1
+++ Makefile.moz 13 Sep 2006 17:50:07 -0000 1.2
@@ -1,4 +1,4 @@
-# ***** 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.
@@ -28,29 +28,25 @@
MDDEPDIR := $(OBJDIR)/.deps
DESTDIR = $(MOZ_OBJDIR)/install
+NO_DIST_INSTALL = 1
-include $(MOZ_OBJDIR)/config/autoconf.mk
-#include $(CORE_DEPTH)/esc/mozilla/config.mk
-
#XULRUNNER release bundle, taken from ftp site
DEPLOY_OBJDIR = $(CORE_DEPTH)/dist/$(OBJDIR)/esc_build
+XULRUNNER_ZIP_NAME = xulrunner-1.8.0.1.*.tar.gz
+XULRUNNER_BIN_PATH = $(MOZ_OBJDIR)/dist/xulrunner
+XULRUNNER_EXEC = xulrunner
ifeq ($(OS_ARCH), Darwin)
XULRUNNER_BIN_PATH = /Library/Frameworks/XUL.framework
XULRUNNER_EXEC = xulrunner-bin
XULRUNNER_FRAME_DEST = ESC.app/Contents/Frameworks/XUL.framework
XULRUNNER_FRAME_BASE = ESC.app/Contents/Frameworks
-else
-XULRUNNER_BIN_PATH = /opt/xulrunner/1.8.0.1/xulrunner
-DEPLOY_OBJDIR = $(CORE_DEPTH)/dist/$(OBJDIR)/esc_build
-XULRUNNER_EXEC = xulrunner
-XULRUNNER_FRAME_DEST = esc
endif
ifeq ($(OS_ARCH), WINNT)
-XULRUNNER_BIN_PATH = C:/"Program Files"/"Mozilla XULRunner"/1.8.0.1/xulrunner
OS_LIBS += crypt32.lib
CSPSRCS = CoolKeyCSP.cpp
endif
@@ -75,7 +71,7 @@
# Ensure that the xpcom classes that we build
# do not export themselves
-DEFINES += -DXPCOM_GLUE $(GECKO_INCLUDES) -I$(CORE_INC)/ckymanager -I$(CORE_INC)/httpchuncked
+DEFINES += -DXPCOM_GLUE $(GECKO_INCLUDES) -I$(CORE_INC)/ckymanager -I$(CORE_INC)/httpchuncked -I./_xpidlgen
REQUIRES = string \
@@ -99,24 +95,26 @@
XPCOM_EXTRA = $(CORE_DIST)/lib/coolkeypk11.dll
ifeq ($(OS_ARCH),Linux)
-INSTALL_STUFF += $(CORE_DEPTH)/esc/app/gtk/CoolKeyLogo.gif
+INSTALL_STUFF +=
endif
-include $(topsrcdir)/config/config.mk
-
-all:: export libs deploy
+install::
+ifdef DESTDIR
+ $(NSINSTALL) $(DEPLOY_OBJDIR)/esc/* $(DESTDIR)
+endif
+all:: export libs
libs:: $(INSTALL_STUFF) rhCoolKey.h
#$(NSINSTALL) $(INSTALL_STUFF) $(DIST)/bin
- $(NSINSTALL) rhCoolKey.h $(DIST)/include/rhCoolKey
+ $(NSINSTALL) rhCoolKey.h $(CORE_INC)/include/rhCoolKey
clean::
rm -f Makefile.in
rm -rf $(DEPLOY_OBJDIR)
- rm -f $(CORE_DEPTH)/esc/app/xul/esc/test.zip
- rm -rf $(CORE_DEPTH)/esc/app/xul/esc/esc
+ rm -rf $(CORE_DEPTH)/src/app/xul/esc/esc
deploy: $(DEPLOY_OBJDIR)
echo "deploy! on $(OS_ARCH)"
@@ -161,28 +159,35 @@
$(DEPLOY_OBJDIR):
echo "Installing!"
- $(NSINSTALL) ./$(LIB_PREFIX)rhCoolKey$(DLL_SUFFIX) $(CORE_DEPTH)/esc/app/xul/esc/components
- $(NSINSTALL) ./_xpidlgen/*.xpt $(CORE_DEPTH)/esc/app/xul/esc/components
+ $(NSINSTALL) ./$(LIB_PREFIX)rhCoolKey$(DLL_SUFFIX) $(CORE_DEPTH)/src/app/xul/esc/components
+ $(NSINSTALL) ./_xpidlgen/*.xpt $(CORE_DEPTH)/src/app/xul/esc/components
echo "Creating $(DEPLOY_OBJDIR)"
mkdir $(DEPLOY_OBJDIR)
- cd $(CORE_DEPTH)/esc/app/xul/esc; zip -r test.zip * -x *\CVS\*; unzip -d esc test.zip
- $(XULRUNNER_BIN_PATH)/$(XULRUNNER_EXEC) --install-app $(CORE_DEPTH)/esc/app/xul/esc/esc $(DEPLOY_OBJDIR)
+ cd $(CORE_DEPTH)/src/app/xul/esc; zip -r test.zip * -x *\CVS\* \*.fix*; unzip -d esc test.zip ; rm -f test.zip
+ $(XULRUNNER_BIN_PATH)/$(XULRUNNER_EXEC) --install-app $(CORE_DEPTH)/src/app/xul/esc/esc $(DEPLOY_OBJDIR)
ifeq ($(OS_ARCH), Darwin)
mkdir $(DEPLOY_OBJDIR)/$(XULRUNNER_FRAME_BASE)
+ cp -Rf -v $(XULRUNNER_BIN_PATH) $(DEPLOY_OBJDIR)/$(XULRUNNER_FRAME_DEST)
# mkdir $(DEPLOY_OBJDIR)/$(XULRUNNER_FRAME_BASE)/XUL.framework
endif
- cp -Rf -v $(XULRUNNER_BIN_PATH) $(DEPLOY_OBJDIR)/$(XULRUNNER_FRAME_DEST)
+ #cp -Rf -v $(XULRUNNER_BIN_PATH) $(DEPLOY_OBJDIR)/$(XULRUNNER_FRAME_DEST)
+
+ tar -xzvf $(MOZ_OBJDIR)/dist/$(XULRUNNER_ZIP_NAME) -C $(DEPLOY_OBJDIR)/$(XULRUNNER_FRAME_DEST)/esc
ifeq ($(OS_ARCH),WINNT)
cp -f $(XPCOM_EXTRA) $(DEPLOY_OBJDIR)/ESC/components
endif
+ifdef DESTDIR
+ $(NSINSTALL) $(DEPLOY_OBJDIR) $(DESTDIR)
+endif
-include $(topsrcdir)/config/rules.mk
ifeq ($(OS_ARCH),WINNT)
IMPORT_LIBRARY=
endif
+
Index: rhCoolKey.cpp
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xpcom/rhCoolKey.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- rhCoolKey.cpp 12 Jun 2006 23:39:50 -0000 1.1.1.1
+++ rhCoolKey.cpp 13 Sep 2006 17:50:07 -0000 1.2
@@ -15,10 +15,11 @@
* All rights reserved.
* END COPYRIGHT BLOCK **/
+#define FORCE_PR_LOG 1
+
#include
#include "rhCoolKey.h"
#include "CoolKey.h"
-#include "CoolKeyPref.h"
#include "nsMemory.h"
#include "nsXPCOM.h"
@@ -95,7 +96,7 @@
CoolKeyShutdownObserver::~CoolKeyShutdownObserver()
{
- PR_LOG( coolKeyLog, 5, ("CoolKeyShutdownObserver::~CoolKeyShutdownObserver \n"));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("CoolKeyShutdownObserver::~CoolKeyShutdownObserver \n"));
}
@@ -108,7 +109,7 @@
if (!strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID))
{
- PR_LOG( coolKeyLog, 5, ("CoolKeyShutdownObserver::Observe shutting down"));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("CoolKeyShutdownObserver::Observe shutting down"));
if(single)
{
@@ -167,7 +168,7 @@
rhCoolKey::rhCoolKey()
:mJsNotify(nsnull),mProxy(nsnull)
{
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::rhCoolKey: %p \n",this));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::rhCoolKey: %p \n",this));
if(!single)
{
@@ -187,7 +188,7 @@
if(res == PR_FALSE)
{
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::rhCoolKey: InitInstance failed. coolKey_instance %p\n",coolKey_instance));
+ PR_LOG( coolKeyLog, PR_LOG_ERROR, ("ESC InitInstance failed,exiting. CoolKey instance %p\n",coolKey_instance));
exit(1);
}
@@ -199,17 +200,17 @@
{
/* destructor code */
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::~rhCoolKey: %p \n",this));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::~rhCoolKey: %p \n",this));
}
void rhCoolKey::ShutDownInstance()
{
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::ShutDownInstance. %p \n",this));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::ShutDownInstance. %p \n",this));
if (mProxy)
{
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::ShutDownInstance: About to dereference Proxy Object. Proxy %p \n",mProxy));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::ShutDownInstance: About to dereference Proxy Object. Proxy %p \n",mProxy));
CoolKeyUnregisterListener(mProxy);
@@ -307,11 +308,11 @@
{
PRBool ret = PR_TRUE;
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::InitInstance %p \n",this));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::InitInstance %p \n",this));
char *path = (char *) GRE_GetXPCOMPath();
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::GREPath %s \n",path));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::GREPath %s \n",path));
char xpcom_path[512];
@@ -326,7 +327,7 @@
sprintf(xpcom_path,"%s/%s",path,lib_name);
#endif
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::xpcom_path %s \n",xpcom_path));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::xpcom_path %s \n",xpcom_path));
XPCOMGlueStartup(xpcom_path);
@@ -346,7 +347,7 @@
}
else
{
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::InitInstance:Can't create proxy. \n"));
+ PR_LOG( coolKeyLog, PR_LOG_ERROR, ("Can't create Proxy Object for ESC. \n"));
}
@@ -402,7 +403,7 @@
observerService->AddObserver(observer, NS_XPCOM_SHUTDOWN_OBSERVER_ID, PR_FALSE);
} else {
- PR_LOG(coolKeyLog,5,("Could not get an observer service. We will leak on shutdown."));
+ PR_LOG(coolKeyLog,PR_LOG_ERROR,("Could not get an observer service. We will leak on shutdown."));
}
return ret;
@@ -414,7 +415,7 @@
rhICoolKey *proxyObject = NULL;
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::CreateProxyObject: \n"));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::CreateProxyObject: \n"));
nsCOMPtr manager =
do_GetService(NS_XPCOMPROXY_CONTRACTID);
@@ -424,7 +425,7 @@
manager->GetProxyForObject(NS_UI_THREAD_EVENTQ, NS_GET_IID(rhICoolKey), this, PROXY_SYNC | PROXY_ALWAYS, (void**)&proxyObject);
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::CreateProxyObject: original: %p proxy %p \n",this,proxyObject));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::CreateProxyObject: original: %p proxy %p \n",this,proxyObject));
return proxyObject;
@@ -433,12 +434,12 @@
CoolKeyNode* rhCoolKey::GetCoolKeyInfo(unsigned long aKeyType, const char * aKeyID)
{
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::GetCoolKeyInfo: gASCAvailableKeys %p looking for key %s type %d \n",&gASCAvailableKeys,aKeyID,aKeyType));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::GetCoolKeyInfo: gASCAvailableKeys %p looking for key %s type %d \n",&gASCAvailableKeys,aKeyID,aKeyType));
std::list::const_iterator it;
for(it=gASCAvailableKeys.begin(); it!=gASCAvailableKeys.end(); ++it) {
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::GetCoolKeyInfo: current key %s type %d, looking for key %s type %d \n",(*it)->mKeyID.get(),(*it)->mKeyType,aKeyID,aKeyType));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::GetCoolKeyInfo: current key %s type %d, looking for key %s type %d \n",(*it)->mKeyID.get(),(*it)->mKeyType,aKeyID,aKeyType));
if ((*it)->mKeyType == aKeyType && !strcmp((*it)->mKeyID.get(), aKeyID))
return *it;
@@ -451,7 +452,7 @@
PRBool rhCoolKey::ASCCoolKeyIsAvailable(unsigned long aKeyType, char * aKeyID)
{
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::ASCCoolKeyIsAvailable type %d id %s \n",aKeyType,aKeyID));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::ASCCoolKeyIsAvailable type %d id %s \n",aKeyType,aKeyID));
return GetCoolKeyInfo(aKeyType, aKeyID) ? PR_TRUE : PR_FALSE;
}
@@ -461,7 +462,7 @@
nsEmbedCString *aKeyID)
{
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::ASCGetAvailableCoolKeyAt: index %d type %d id %s \n",aIndex,aKeyType,aKeyID));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::ASCGetAvailableCoolKeyAt: index %d type %d id %s \n",aIndex,aKeyType,aKeyID));
if (!aKeyType || !aKeyID)
return E_FAIL;
@@ -488,7 +489,7 @@
{
int size = (int) gASCAvailableKeys.size();
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::ASCGetNumAvailableCoolKeys %d \n",size));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::ASCGetNumAvailableCoolKeys %d \n",size));
return size;
}
@@ -501,21 +502,21 @@
rhIKeyNotify* rhCoolKey::GetNotifyKeyListener(rhIKeyNotify *listener){
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::GetNotifyKeyListener: %p size %d \n",listener,gNotifyListeners.size() ));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::GetNotifyKeyListener: %p size %d \n",listener,gNotifyListeners.size() ));
std::list >::const_iterator it;
for(it=gNotifyListeners.begin(); it!=gNotifyListeners.end(); ++it) {
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::GetNotifyKeyListener: cur %p looking for %p \n",(*it).get(),listener));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::GetNotifyKeyListener: cur %p looking for %p \n",(*it).get(),listener));
if((*it) == listener)
{
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::GetNotifyKeyListener: looking for %p returning %p \n",listener,(*it).get()));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::GetNotifyKeyListener: looking for %p returning %p \n",listener,(*it).get()));
return (*it);
}
}
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::GetNotifyKeyListener: looking for %p returning NULL. \n",listener));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::GetNotifyKeyListener: looking for %p returning NULL. \n",listener));
return nsnull;
}
@@ -587,23 +588,19 @@
if (!node)
{
- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::InsertKeyIntoAvailableList: Can't create CoolKeyNode \n"));
+ PR_LOG( coolKeyLog, PR_LOG_ERROR, ("Can't create new CoolKey Data Structure. \n"));
return;
-
}
-
- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::InsertKeyIntoAvailableList: about to add node to available key list.\n"));
gASCAvailableKeys.push_back(node);
-
}
void rhCoolKey::RemoveKeyFromAvailableList(unsigned long aKeyType, const char * aKeyID)
{
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::RemoveKeyFromAvailableList type %d id %s \n",aKeyType,aKeyID));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::RemoveKeyFromAvailableList type %d id %s \n",aKeyType,aKeyID));
CoolKeyNode *node = GetCoolKeyInfo(aKeyType, aKeyID);
if (!node)
@@ -615,7 +612,7 @@
void rhCoolKey::ClearAvailableList()
{
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::ClearAvailableList \n"));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::ClearAvailableList \n"));
while (gASCAvailableKeys.size() > 0) {
CoolKeyNode *node = gASCAvailableKeys.front();
delete node;
@@ -625,7 +622,7 @@
HRESULT rhCoolKey::ASCSetCoolKeyPin(unsigned long aKeyType, const char * aKeyID, const char * aPin)
{
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::ASCSetCoolKeyPin type %d id %s pin %s \n",aKeyType,aKeyID,aPin));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::ASCSetCoolKeyPin type %d id %s pin %s \n",aKeyType,aKeyID,aPin));
CoolKeyNode *node = GetCoolKeyInfo(aKeyType, aKeyID);
if (!node)
return E_FAIL;
@@ -639,7 +636,7 @@
NS_IMETHODIMP rhCoolKey::RhNotifyKeyStateChange(PRUint32 aKeyType,const char *aKeyID, PRUint32 aKeyState, PRUint32 aData,const char* strData)
{
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::RhNotifyKeyStateChange: id: %s type: %d state %d data: %d \n",aKeyID,aKeyType, aKeyState,aData));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::RhNotifyKeyStateChange: id: %s type: %d state %d data: %d \n",aKeyID,aKeyType, aKeyState,aData));
CoolKeyNode tempKey(aKeyType, aKeyID,(CoolKeyStatus) aKeyState);
CoolKeyNode *node = NULL;
@@ -657,12 +654,12 @@
if (CoolKeyIsEnrolled(&key))
keyStatus = eAKS_Available; else if (CoolKeyHasApplet(&key)) keyStatus = eAKS_Uninitialized;
- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::RhNotifyKeyStateChange: Key Inserted. keyStatus %d \n",keyStatus));
+ PR_LOG( coolKeyLog, PR_LOG_ALWAYS, ("Key Inserted. ID %s \n",aKeyID));
InsertKeyIntoAvailableList(tempKey.mKeyType,aKeyID ,(CoolKeyStatus) keyStatus);
break;
}
case eCKState_KeyRemoved:
- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::RhNotifyKeyStateChange: Key Removed. \n"));
+ PR_LOG( coolKeyLog, PR_LOG_ALWAYS, ("Key Removed. ID %s \n",aKeyID));
RemoveKeyFromAvailableList(tempKey.mKeyType, aKeyID);
break;
case eCKState_EnrollmentComplete:
@@ -700,8 +697,6 @@
std::list< nsCOMPtr >::const_iterator it;
for(it=gNotifyListeners.begin(); it!=gNotifyListeners.end(); ++it) {
- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::RhNotifyKeyStateChange about to call RhNotifyKeyStateChange listener: %p",(*it).get()));
-
((rhIKeyNotify *) (*it))->RhNotifyKeyStateChange(aKeyType,aKeyID,aKeyState,aData,strData);
PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::RhNotifyKeyStateChange after call to RhNotifyKeyStateChange listener: %p",(*it).get()));
@@ -709,100 +704,33 @@
}
- // Do any post processing:
-
- switch (aKeyState)
- {
- case eCKState_KeyInserted:
- if (gAutoEnrollBlankTokens && !CoolKeyIsEnrolled(&key))
- //ASCEnrollCoolKey(aKey->mKeyType, keyID, "housekey"), NULL, NULL,NULL,NULL);
- break;
- }
-
- return NS_OK;
-
+ return NS_OK;
}
NS_IMETHODIMP rhCoolKey::RhCoolKeyUnSetNotifyCallback(rhIKeyNotify *jsNotify)
{
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::RhCoolKeyUnSetNotifyCallback Object: input %p this %p \n",jsNotify,this));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::RhCoolKeyUnSetNotifyCallback Object: input %p this %p \n",jsNotify,this));
RemoveNotifyKeyListener(jsNotify);
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::RhCoolKeyUnSetNotifyCallback Object: removed listener, size now %d \n",GetNotifyKeyListenerListSize()));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::RhCoolKeyUnSetNotifyCallback Object: removed listener, size now %d \n",GetNotifyKeyListenerListSize()));
if(GetNotifyKeyListenerListSize() == 0)
{
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::RhCoolKeyUnSetNotifyCallback Object: input %p this %p Listener size 0. \n",jsNotify,this));
-
- /* if(mProxy)
- {
-
- CoolKeyUnregisterListener(mProxy);
- NS_RELEASE(mProxy);
- mProxy = nsnull;
-
- }
-*/
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::RhCoolKeyUnSetNotifyCallback Object: input %p this %p Listener size 0. \n",jsNotify,this));
}
-
-/*
- if(!jsNotify || !mJsNotify)
- {
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::RhCoolKeyUnSetNotifyCallback: KeyNotify already unset. \n"));
- return NS_OK;
-
- }
-
- if(jsNotify == mJsNotify)
- {
- mJsNotify = nsnull;
-
- if(mProxy)
- {
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::RhCoolKeyUnSetNotifyCallback: About to dereference Proxy Object. Proxy %p \n",mProxy));
-
- CoolKeyUnregisterListener(mProxy);
-
- NS_RELEASE(mProxy);
-
- mProxy = nsnull;
- }
-
- }
- else
- {
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::RhCoolKeyUnSetNotifyCallback: Input Notify Object not equal to member property. \n"));
- }
-
-*/
-
return NS_OK;
}
NS_IMETHODIMP rhCoolKey::RhCoolKeySetNotifyCallback(rhIKeyNotify *jsNotify)
{
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::RhCoolKeySetNotifyCallback Object: %p this %p\n",jsNotify,this));
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::RhCoolKeySetNotifyCallback Object: %p this %p\n",jsNotify,this));
-
-
- AddNotifyKeyListener(jsNotify);
-
-
- /* if(!jsNotify || mJsNotify)
- {
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::RhCoolKeySetNotifyCallback: returning error. \n"));
- return NS_ERROR_FAILURE;
-
- }
-
- mJsNotify = jsNotify;
-
-*/
+ AddNotifyKeyListener(jsNotify);
return NS_OK;
@@ -817,14 +745,12 @@
if (!node)
{
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::RhBlinkCoolKey: GetCoolKeyInfo failed. \n"));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::RhBlinkCoolKey: GetCoolKeyInfo failed. \n"));
return NS_ERROR_FAILURE;
}
-
if (!aKeyID)
{
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::RhBlinkCoolKey: aKeyID is null. \n"));
return NS_ERROR_FAILURE ;
}
@@ -846,7 +772,7 @@
NS_IMETHODIMP rhCoolKey::EnrollCoolKey(PRUint32 aKeyType, const char *aKeyID, const char *aEnrollmentType, const char *aScreenName, const char *aPin, const char *aScreenNamePWord, const char *aTokenCode)
{
- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::RhEnrollCoolKey thread: %p \n",PR_GetCurrentThread()));
+ PR_LOG( coolKeyLog, PR_LOG_ALWAYS, ("Attempting to Enroll Key ,ID: %s \n",aKeyID));
CoolKeyNode *node = GetCoolKeyInfo(aKeyType, aKeyID);
@@ -870,7 +796,6 @@
return NS_OK;
}
-
return NS_OK;
}
@@ -879,7 +804,7 @@
NS_IMETHODIMP rhCoolKey::ResetCoolKeyPIN(PRUint32 aKeyType, const char *aKeyID, const char *aScreenName, const char *aPIN, const char *aScreenNamePwd)
{
- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::RhResetCoolKeyPIN thread: %p \n",PR_GetCurrentThread()));
+ PR_LOG( coolKeyLog, PR_LOG_ALWAYS, ("Attempting to Reset Key PIN, ID: %s \n",aKeyID));
CoolKeyNode *node = GetCoolKeyInfo(aKeyType, aKeyID);
if (!node)
@@ -923,7 +848,7 @@
NS_IMETHODIMP rhCoolKey::RenewCoolKey(PRUint32 aKeyType, const char *aKeyID)
{
- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::RhRenewCoolKey (not implemented) thread: %p \n",PR_GetCurrentThread()));
+ PR_LOG( coolKeyLog, PR_LOG_ERROR, ("rhCoolKey::RhRenewCoolKey (not implemented) thread: %p \n",PR_GetCurrentThread()));
return NS_ERROR_NOT_IMPLEMENTED;
}
@@ -932,7 +857,7 @@
NS_IMETHODIMP rhCoolKey::FormatCoolKey(PRUint32 aKeyType, const char *aKeyID, const char *aEnrollmentType, const char *aScreenName, const char *aPIN, const char *aScreenNamePWord, const char *aTokenCode)
{
- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::RhFormatCoolKey thread: %p \n",PR_GetCurrentThread()));
+ PR_LOG( coolKeyLog, PR_LOG_ALWAYS, ("Attempting to Format Key, ID: %s. ",aKeyID));
CoolKeyNode *node = GetCoolKeyInfo(aKeyType, aKeyID);
if (!node)
@@ -975,7 +900,6 @@
NS_IMETHODIMP rhCoolKey::CancelCoolKeyOperation(PRUint32 aKeyType, const char *aKeyID)
{
- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::RhCancelCoolKeyOperation thread: %p \n",PR_GetCurrentThread()));
CoolKeyNode *node = GetCoolKeyInfo(aKeyType, aKeyID);
if (!node)
@@ -983,14 +907,14 @@
PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::RhCancelCoolKeyOperation type %d id %s status %d: \n",aKeyType,aKeyID,node->mStatus));
+
// If the key isn't busy, then there's nothing to do.
if (node->mStatus != eAKS_EnrollmentInProgress &&
node->mStatus != eAKS_UnblockInProgress &&
node->mStatus != eAKS_PINResetInProgress &&
node->mStatus != eAKS_RenewInProgress &&
- node->mStatus != eAKS_FormatInProgress) // &&
- // node->mStatus != eAKS_BlinkInProgress)
+ node->mStatus != eAKS_FormatInProgress)
return NS_OK;
AutoCoolKey key(aKeyType, aKeyID);
@@ -1008,7 +932,6 @@
NS_IMETHODIMP rhCoolKey::GetCoolKeyCertNicknames(PRUint32 aKeyType, const char *aKeyID, PRUint32 *count, char ***str)
{
-
if(!aKeyID || !count)
{
return NS_ERROR_FAILURE;
@@ -1065,7 +988,6 @@
NS_IMETHODIMP rhCoolKey::GetAvailableCoolKeys(PRUint32 *count, char ***str)
{
-
PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::RhGetAvailableCoolKeys thread: %p \n",PR_GetCurrentThread()));
if(!count || !str)
@@ -1077,12 +999,11 @@
long numKeys = ASCGetNumAvailableCoolKeys();
- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::RhGetAvailableCoolKeys num keys found: %d \n",numKeys));
+ PR_LOG( coolKeyLog, PR_LOG_ALWAYS, ("Attempting to get number of keys. Value: %d \n",numKeys));
if(numKeys == 0)
{
return NS_OK;
-
}
array = (char **) nsMemory::Alloc((sizeof(char *) * numKeys));
@@ -1103,8 +1024,6 @@
const char *id = keyID.get();
- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::RhGetAvailableCoolKeys iter %d id %s\n",i,id));
-
array[i] = NULL;
if(id)
@@ -1141,7 +1060,6 @@
*_retval = eAKS_Unavailable;
}
-
PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::RhGetCoolKeyStatus retval: %d \n",*_retval));
@@ -1185,15 +1103,38 @@
{
char *info = (char *) certInfo.c_str();
-
char *temp = (char *) nsMemory::Clone(info,sizeof(char) * strlen(info) + 1);
-
*aCertInfo = temp;
-
}
return NS_OK;
}
+
+
+/* string GetCoolKeyIssuerInfo (in unsigned long aKeyType, in string aKeyID); */ NS_IMETHODIMP rhCoolKey::GetCoolKeyIssuerInfo(PRUint32 aKeyType, const char *aKeyID, char **_retval)
+ {
+
+ *_retval = NULL;
+
+ AutoCoolKey key(aKeyType, aKeyID);
+
+ char issuerInfo[256];
+
+ HRESULT res = CoolKeyGetIssuerInfo(&key, (char *)&issuerInfo,256);
+
+ PR_LOG( coolKeyLog, PR_LOG_ALWAYS, ("Attempting to get the key's Issuer: Key: %s, Issuer %s. \n",aKeyID, (char *) issuerInfo));
+
+ if(res == S_OK)
+ {
+ char *temp = (char *) nsMemory::Clone(issuerInfo,sizeof(char) * strlen((char *)issuerInfo) + 1);
+ *_retval = temp;
+
+ }
+ return NS_OK;
+
+ }
+
+
/* void rhGetCoolKeyPolicy (in unsigned long aKeyType, in string aKeyID, out string policy); */
NS_IMETHODIMP rhCoolKey::GetCoolKeyPolicy(PRUint32 aKeyType, const char *aKeyID, char **policy)
{
@@ -1207,7 +1148,6 @@
char policyChar[MAX_STR_LEN] ;
policyChar[0] = 0;
-
AutoCoolKey key(aKeyType, aKeyID);
HRESULT hres = CoolKeyGetPolicy(&key, policyChar, MAX_STR_LEN);
@@ -1226,12 +1166,45 @@
return NS_OK;
}
+
+/* string GetCoolKeyIssuedTo (in unsigned long aKeyType, in string aKeyID); */
+NS_IMETHODIMP rhCoolKey::GetCoolKeyIssuedTo(PRUint32 aKeyType, const char *aKeyID, char **issuedTo)
+{
+ if (!aKeyID) {
+ return NS_ERROR_FAILURE;
+ }
+
+ AutoCoolKey key(aKeyType, ( char *)aKeyID);
+
+ // const char *keyName = CoolKeyGetTokenName(&key);
+
+ char buff[512];
+ int bufLength = 512;
+ buff[0] = 0;
+
+ CoolKeyGetIssuedTo(&key, (char *) buff, bufLength);
+
+
+ if(!buff[0])
+ {
+ return NS_OK;
+ }
+
+ PR_LOG(coolKeyLog,PR_LOG_DEBUG,("rhCoolKey::RhGetCoolKeyGetIssuedTo %s \n",(char *) buff));
+
+ char *temp = (char *) nsMemory::Clone(buff,sizeof(char) * strlen(buff) + 1);
+
+ *issuedTo = temp;
+
+ return NS_OK;
+
+}
/* boolean SetCoolKeyConfigValue (in string aName, in string aValue); */
NS_IMETHODIMP rhCoolKey::SetCoolKeyConfigValue(const char *aName, const char *aValue, PRBool *_retval)
{
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::SetCoolKeyConfigValue thread: %p \n",PR_GetCurrentThread()));
if(!aName || !aValue)
{
-
*_retval = 0;
return NS_ERROR_FAILURE;
}
@@ -1244,6 +1217,7 @@
/* string GetCoolKeyConfigValue (in string aName); */
NS_IMETHODIMP rhCoolKey::GetCoolKeyConfigValue(const char *aName, char **_retval)
{
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::GetCoolKeyConfigValue thread: %p \n",PR_GetCurrentThread()));
if(!aName)
{
@@ -1252,7 +1226,6 @@
*_retval = (char *) doGetCoolKeyConfigValue(aName);
-
return NS_OK;
}
@@ -1344,7 +1317,7 @@
{
PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::GetCoolKeyVersion \n"));
- char *version = "1.2.0";
+ char *version = "1.0.0-10";
char *versionVal = (char *) nsMemory::Clone(version,sizeof(char) * strlen(version) + 1);
@@ -1360,19 +1333,6 @@
// Implement full module and factory dance so we can see what is going on
-//static const nsModuleComponentInfo components[] =
-//{
-// { "CoolKey",
-// COOLKEY_CID,
-// "@redhat.com/rhcoolkey",
-// rhCoolKeyConstructor
-// }
-//};
-
-//NS_IMPL_NSGETMODULE(nsSampleModule, components)
-
-
-// factory implementation class for component
class rhCoolKeyFactory: public nsIFactory{
private:
nsrefcnt mRefCnt;
@@ -1501,7 +1461,7 @@
NS_IMETHODIMP_(nsrefcnt)
rhCoolKeyModule::AddRef(void)
{
-PR_LOG( coolKeyLog, 5, ("rhCoolKeyModule::AddRef \n"));
+PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKeyModule::AddRef \n"));
++mRefCnt;
return mRefCnt;
}
@@ -1510,7 +1470,7 @@
NS_IMETHODIMP_(nsrefcnt)
rhCoolKeyModule::Release(void)
{
-PR_LOG( coolKeyLog, 5, ("rhCoolKeyModule::Release \n"));
+PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKeyModule::Release \n"));
--mRefCnt;
if (mRefCnt == 0) {
mRefCnt = 1; /* stabilize */
@@ -1524,7 +1484,7 @@
NS_IMETHODIMP
rhCoolKeyModule::QueryInterface(REFNSIID aIID, void** aInstancePtr)
{
-PR_LOG( coolKeyLog, 5, ("rhCoolKeyModule::QueryInterface \n"));
+PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKeyModule::QueryInterface \n"));
if ( !aInstancePtr )
return NS_ERROR_NULL_POINTER;
@@ -1558,7 +1518,7 @@
void** result)
{
-PR_LOG( coolKeyLog, 5, ("rhCoolKeyModule::GetClassObject \n"));
+PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKeyModule::GetClassObject \n"));
if (!kCoolKeyCID.Equals(aClass))
return NS_ERROR_FACTORY_NOT_REGISTERED;
@@ -1589,7 +1549,7 @@
nsIComponentRegistrar* compReg = nsnull;
-PR_LOG( coolKeyLog, 5, ("rhCoolKeyModule::RegisterSelf \n"));
+PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKeyModule::RegisterSelf \n"));
nsresult rv = aCompMgr->QueryInterface(kIComponentRegistrarIID, (void**)&compReg);
if (NS_FAILED(rv))
return rv;
@@ -1612,7 +1572,7 @@
const char* registryLocation)
{
-PR_LOG( coolKeyLog, 5, ("rhCoolKeyModule::UnregisterSelf \n"));
+PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKeyModule::UnregisterSelf \n"));
nsIComponentRegistrar* compReg = nsnull;
nsresult rv = aCompMgr->QueryInterface(kIComponentRegistrarIID, (void**)&compReg);
@@ -1642,7 +1602,7 @@
{
nsresult rv = NS_OK;
-PR_LOG( coolKeyLog, 5, ("rhCoolKeyModule::NSGetModule \n"));
+PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKeyModule::NSGetModule \n"));
// Create and initialize the module instance
rhCoolKeyModule *m = new rhCoolKeyModule();
Index: rhICoolKey.idl
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xpcom/rhICoolKey.idl,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- rhICoolKey.idl 12 Jun 2006 23:39:49 -0000 1.1.1.1
+++ rhICoolKey.idl 13 Sep 2006 17:50:07 -0000 1.2
@@ -56,10 +56,14 @@
boolean GetCoolKeyIsEnrolled(in unsigned long aKeyType, in string aKeyID);
+ string GetCoolKeyIssuerInfo(in unsigned long aKeyType, in string aKeyID);
+
string GetCoolKeyPolicy(in unsigned long aKeyType,in string aKeyID);
string GetCoolKeyCertInfo(in unsigned long aKeyType, in string aKeyID, in string aCertNickname);
+ string GetCoolKeyIssuedTo(in unsigned long aKeyType, in string aKeyID);
+
boolean GetCoolKeyRequiresAuthentication(in unsigned long aKeyType,in string aKeyID);
boolean GetCoolKeyIsAuthenticated(in unsigned long aKeyType,in string aKeyID);
From fedora-directory-commits at redhat.com Wed Sep 13 17:52:07 2006
From: fedora-directory-commits at redhat.com (Jack Magne (jmagne))
Date: Wed, 13 Sep 2006 10:52:07 -0700
Subject: [Fedora-directory-commits] esc/src/app/xul/esc/components - New
directory
Message-ID: <200609131752.k8DHq78T012791@cvs-int.fedora.redhat.com>
Author: jmagne
Update of /cvs/dirsec/esc/src/app/xul/esc/components
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12776/components
Log Message:
Directory /cvs/dirsec/esc/src/app/xul/esc/components added to the repository
From fedora-directory-commits at redhat.com Wed Sep 13 17:52:40 2006
From: fedora-directory-commits at redhat.com (Jack Magne (jmagne))
Date: Wed, 13 Sep 2006 10:52:40 -0700
Subject: [Fedora-directory-commits]
esc/src/app/xul/esc/components escCLH.js, NONE, 1.1
Message-ID: <200609131752.k8DHqeRh012818@cvs-int.fedora.redhat.com>
Author: jmagne
Update of /cvs/dirsec/esc/src/app/xul/esc/components
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12802
Added Files:
escCLH.js
Log Message:
Initial revision.
--- NEW FILE escCLH.js ---
/*
* -myapp commandline handler; starts up My App.
*/
const nsIAppShellService = Components.interfaces.nsIAppShellService;
const nsISupports = Components.interfaces.nsISupports;
const nsICategoryManager = Components.interfaces.nsICategoryManager;
const nsIComponentRegistrar = Components.interfaces.nsIComponentRegistrar;
const nsICommandLine = Components.interfaces.nsICommandLine;
const nsICommandLineHandler = Components.interfaces.nsICommandLineHandler;
const nsIFactory = Components.interfaces.nsIFactory;
const nsIModule = Components.interfaces.nsIModule;
const nsIWindowWatcher = Components.interfaces.nsIWindowWatcher;
var consoleService = Components
.classes['@mozilla.org/consoleservice;1']
.getService( Components.interfaces.nsIConsoleService );
function recordMessage( message ) {
consoleService.logStringMessage("esc: " + message + "\n");
}
/*
* Classes
*/
const escCLH = {
/* nsISupports */
QueryInterface : function clh_QI(iid) {
if (iid.equals(nsICommandLineHandler) ||
iid.equals(nsIFactory) ||
iid.equals(nsISupports))
return this;
throw Components.results.NS_ERROR_NO_INTERFACE;
},
/* nsICommandLineHandler */
handle : function clh_handle(cmdLine) {
var args = new Object();
args.urlopt = false;
recordMessage("handle command line");
try {
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"].getService(Components.interfaces.nsIWindowMediator);
var win = wm.getMostRecentWindow(null);
if(win)
{
recordMessage("Subsequent invocation. Launch an Admin page.");
win.launchSETTINGS();
return;
}
var chromeURI = "chrome://esc/content/hiddenWindow.xul";
recordMessage(chromeURI);
var wwatch = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
.getService(nsIWindowWatcher);
wwatch.openWindow(null, chromeURI, "_blank",
"chrome,dialog,height=-1,width=-1,popup=yes", cmdLine);
}
catch(e) {}
},
helpInfo : " -myapp Open the My App.\n",
/* nsIFactory */
createInstance : function clh_CI(outer, iid) {
if (outer != null)
throw Components.results.NS_ERROR_NO_AGGREGATION;
return this.QueryInterface(iid);
},
lockFactory : function clh_lock(lock) {
/* no-op */
}
};
const clh_contractID = "@redhat.com/esc-clh;1";
const clh_CID = Components.ID("{36c65861-52a8-4ce9-aa3b-235b88216ed4}");
const clh_category = "c-esc";
const escCLHModule = {
/* nsISupports */
QueryInterface : function mod_QI(iid) {
if (iid.equals(nsIModule) ||
iid.equals(nsISupports))
return this;
throw Components.results.NS_ERROR_NO_INTERFACE;
},
/* nsIModule */
getClassObject : function mod_gch(compMgr, cid, iid) {
if (cid.equals(clh_CID))
return escCLH.QueryInterface(iid);
throw Components.results.NS_ERROR_NOT_REGISTERED;
},
registerSelf : function mod_regself(compMgr, fileSpec, location, type) {
compMgr.QueryInterface(nsIComponentRegistrar);
compMgr.registerFactoryLocation(clh_CID,
"escCLH",
clh_contractID,
fileSpec,
location,
type);
var catMan = Components.classes["@mozilla.org/categorymanager;1"]
.getService(nsICategoryManager);
catMan.addCategoryEntry("command-line-handler",
clh_category,
clh_contractID, true, true);
},
unregisterSelf : function mod_unreg(compMgr, location, type) {
compMgr.QueryInterface(nsIComponentRegistrar);
compMgr.unregisterFactoryLocation(clh_CID, location);
var catMan = Components.classes["@mozilla.org/categorymanager;1"]
.getService(nsICategoryManager);
catMan.deleteCategoryEntry("command-line-handler", clh_category);
},
canUnload : function (compMgr) {
return true;
}
};
/* Module initialisation */
function NSGetModule(comMgr, fileSpec) {
return escCLHModule;
}
From fedora-directory-commits at redhat.com Wed Sep 13 17:53:42 2006
From: fedora-directory-commits at redhat.com (Jack Magne (jmagne))
Date: Wed, 13 Sep 2006 10:53:42 -0700
Subject: [Fedora-directory-commits]
esc/src/app/xul/esc/defaults/preferences esc-prefs.js, 1.1.1.1, 1.2
Message-ID: <200609131753.k8DHrgQZ012852@cvs-int.fedora.redhat.com>
Author: jmagne
Update of /cvs/dirsec/esc/src/app/xul/esc/defaults/preferences
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12835
Modified Files:
esc-prefs.js
Log Message:
Update to the latest.
Index: esc-prefs.js
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/defaults/preferences/esc-prefs.js,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- esc-prefs.js 12 Jun 2006 23:39:51 -0000 1.1.1.1
+++ esc-prefs.js 13 Sep 2006 17:53:40 -0000 1.2
@@ -15,7 +15,7 @@
* All rights reserved.
* END COPYRIGHT BLOCK **/
-pref("toolkit.defaultChromeURI", "chrome://esc/content/settings.xul");
+#pref("toolkit.defaultChromeURI", "chrome://esc/content/settings.xul");
pref("esc.tps.url","http://test.host.com:7888/nk_service");
@@ -23,7 +23,7 @@
#pref("esc.enroll.ui.url","http://test.host.com:7888/cgi-bin/esc.cgi?action=autoenroll");
#pref("esc.enrolled.token.url","http://www.test.com");
-pref("esc.hide.on.startup","yes");
+pref("esc.hide.on.startup","no");
@@ -33,3 +33,11 @@
pref("capability.principal.codebase.p0.id", "file://");
pref("esc.tps.message.timeout","90");
+
+pref("esc.factory.mode","no");
+pref("esc.show.tabs.ui","no");
+
+pref("browser.dom.window.dump.enabled",true);
+pref("javascript.options.showInConsole",true);
+pref("nglayout.debug.disable_xul_cache",true);
+pref("nglayour.debug.disable_xul_fastload",true);
From fedora-directory-commits at redhat.com Wed Sep 13 17:54:38 2006
From: fedora-directory-commits at redhat.com (Jack Magne (jmagne))
Date: Wed, 13 Sep 2006 10:54:38 -0700
Subject: [Fedora-directory-commits] esc/src/app/xul/esc/chrome/icons - New
directory
Message-ID: <200609131754.k8DHscPY012893@cvs-int.fedora.redhat.com>
Author: jmagne
Update of /cvs/dirsec/esc/src/app/xul/esc/chrome/icons
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12875/icons
Log Message:
Directory /cvs/dirsec/esc/src/app/xul/esc/chrome/icons added to the repository
From fedora-directory-commits at redhat.com Wed Sep 13 17:54:51 2006
From: fedora-directory-commits at redhat.com (Jack Magne (jmagne))
Date: Wed, 13 Sep 2006 10:54:51 -0700
Subject: [Fedora-directory-commits]
esc/src/app/xul/esc/chrome/icons/default - New directory
Message-ID: <200609131754.k8DHspBq012914@cvs-int.fedora.redhat.com>
Author: jmagne
Update of /cvs/dirsec/esc/src/app/xul/esc/chrome/icons/default
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12899/default
Log Message:
Directory /cvs/dirsec/esc/src/app/xul/esc/chrome/icons/default added to the repository
From fedora-directory-commits at redhat.com Wed Sep 13 17:56:09 2006
From: fedora-directory-commits at redhat.com (Jack Magne (jmagne))
Date: Wed, 13 Sep 2006 10:56:09 -0700
Subject: [Fedora-directory-commits] esc/src/app/xul/esc/chrome/locale/en-US
esc.dtd, 1.1.1.1, 1.2 esc.properties, 1.1.1.1, 1.2
Message-ID: <200609131756.k8DHu94I012951@cvs-int.fedora.redhat.com>
Author: jmagne
Update of /cvs/dirsec/esc/src/app/xul/esc/chrome/locale/en-US
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12932
Modified Files:
esc.dtd esc.properties
Log Message:
Update to Latest.
Index: esc.dtd
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/locale/en-US/esc.dtd,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- esc.dtd 12 Jun 2006 23:39:50 -0000 1.1.1.1
+++ esc.dtd 13 Sep 2006 17:56:06 -0000 1.2
@@ -15,39 +15,68 @@
* All rights reserved.
***** END COPYRIGHT BLOCK ***** -->
-
-
-
+
+
+
+
+
+
+
-
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: esc.properties
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/locale/en-US/esc.properties,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- esc.properties 12 Jun 2006 23:39:50 -0000 1.1.1.1
+++ esc.properties 13 Sep 2006 17:56:06 -0000 1.2
@@ -5,8 +5,7 @@
#
# 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.
-#
+# 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.
@@ -15,66 +14,158 @@
# All rights reserved.
# ***** END COPYRIGHT BLOCK
+#ESC strings used in Javascript
+#Strings for ESC.js
+escTitle=Smart Card Manager
+smartCard=smart card
+smartCardU=Smart Card
+enrolledKey=Enrolled
+noKeysPresent=No Cards Present
+blankKey=Blank
+uninitializedKey=Uninitialized
+statusEnrolled=ENROLLED
+statusUnavailable=UNAVAILABLE
+statusNoApplet=NO APPLET
+statusUninitialized=UNINITIALIZED
+statusUnknown=UNKNOWN
+statusBusy=BUSY
+unknownIssuer=Unknown Issuer
+redHatUser=User
+statusUnknown=Unknown
+tokenInformation=CARD INFORMATION
+advancedInformation=Diagnostics Information
+keyID=Key ID:
+tpsURI=Server URL:
+tpsUI=External UI URL:
+status=Status:
+issuer=Issuer:
+escLogEntries=Log Entries
+noLogFileOrData=No Log File or Log File Has No Data.
+certsOnToken=CERTIFICATES on KEY
+certificateNickname=Certificate Nickname:
+coolkeyComponentVersion=Smart Card Manager Version:
+coolkeyDetectedNumberKeys=Number of Smart Cards Detected:
+enrolledDetected=Enrolled Smart Card Detected
+enrolledDetectedMessage=Smart Card Manager has detected an enrolled card. If you would rather not re-enroll this card press "Close".
+formatingToken=Formatting...
+enrollingToken=Enrolling...
+resettingTokenPIN=Resetting Password...
+cancellingOperation=Cancelling...
+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.
+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.
+#ESC Error Messages from TPS
+errorNone=Operation Completed Successfully.
+serverError=Smart Card Server error.
+errorProblemResetTokenPin=Problem resetting smart card's pin.
+errorTokenEnrollment=Smart card enrollment error.
+errorCommCA=Error communicating with the Certification Authority.
+errorInternalServer=Internal Smart Card Server error.
+errorResetPin=Error resetting the smart card's password.
+errorInternalServer=Internal Smart Card Server error.
+errorAuthFailure=Smart Card Server authentication failure.
+errorTokenDisabled=Your smart card is listed as disabled.
+errorProblemCommToken=Problem communicating with the smart card.
+errorTokenUpgrade=Cannot upgrade smart card software.
+errorInvalidTokenType=Invalid smart card type.
+errorCannotPublish=Cannot publish smart card information.
+errorCommTokenDB=Cannot communicate with smart card database.
+errorPinReset=Cannot reset the password value for the smart card.
+errorConnLost=Connection to Smart Card Server.
+errorEntryTokenDB=Can not create entry for smart card in smart card database.
+errorNoTokenState=Smart card found to be in an inconsistent state.
+errorInvalidLostTokenReason=Invalid reason for lost smart card submitted.
+errorTokenUnusable=Smart card found to be unusable due to compromise.
+errorNoInactiveToken=No such inactive smart card found.
+errorProcessMultiTokens=Can not process more than one active smart card.
+errorKeyRecoveryProcessed=Smart card key recovery has been processed.
+errorKeyRecoveryFailed=Smart card key recovery failed.
+errorNoOperateLostToken=Cannot process this smart card, which has been reported lost.
+errorKeyArchival=Smart card key archival error.
+errorConnTKS=Problem connecting to the Smart Card TKS Server.
+errorFailUpdateTokenDB=Failed to update smart card database.
+errorCertRevocation=Internal certificate revocation error discovered.
+errorNotOwnToken=User does not own this smart card.
+errorESCMisconfigured=Smart Card Manager has been misconfigured.
+errorESCNoCommCardReader=Smart Card Manager can't communicate with card reader.
+errorESCNoTokenSession=Smart Card Manager can't initiate session with smart card.
+errorESCNoTalkTPS=Smart Card Manager can't talk to Smart Card Server.
+errorESCNoTalkTokenReader=Smart Card Manager can't talk to smart card reader.
+#ESC text in general Alert messages
+errorCoolKeyIsAuth=coolkey.GetCoolKeyIsAuthenticated() failed!
+errorAuthCoolKey=coolkey.AuthenticateCoolKey failed!
errorJsNotifyInterface=Can't find jsNotify interface.
-errorUniversalXPConnect=Can't get UniversalXPConnect
+errorUniversalXPConnect=Can't get UniversalXPConnect.
+errorConfigValue=Error obtaining issuer info for key.
errorConfigValue=Error Getting Config Value:
+errorSetConfigValue=Error SettingConfig Value:
errorBlankTPSURI=Blank Tps Uri submitted.
-aboutToTestTPSURI=About to test TPS URI:
-errorSelectKey=Please select a key.
-tpsURLContacted=TPS URL has been successfully contacted.
-errorContactTPSURL=Error contacting TPS URL, reconfigure and try again.
+noTpsConfigUrl=You must provide a Url to test!
+aboutToTestTPSURI=About to test Smart Card Server URI:
+errorSelectKey=Please select a Smart card.
+tpsURLContacted=Smart Card Server URL has been successfully contacted.
+errorContactTPSURL=Error contacting Smart Card Server URL, reconfigure and try again.
errorBlankEnrollURI=Blank Enroll Uri submitted.
-aboutToTestEnrollURI=About to test Enroll URI:
-enrollURLContacted=ESC Enrollment URL has been successfully contacted.
-errorContactEnrollURL=Error contacting ESC Enroll URL, reconfigure and try again.
-tpsURIMustHaveValue=TPS URI item must have a value!
-errorSetConfigValue=Error setting config value!:
+aboutToTestEnrollURI=About to test Enroll URI:
+enrollURLContacted=x Enrollment URL has been successfully contacted.
+errorContactEnrollURL=Error contacting Enroll URL, reconfigure and try again.
+tpsConfigSuccess=Smart Card Server config information successfully obtained!
+tpsConfigError=Error obtaining Smart Card Server config information!
+tpsConfigTest=About to test the Smart Card Server Phone Home Url :
+tpsNoConfigUrl=Provide a valid Smart Card Server config URL!
+tpsURIMustHaveValue=Smart Card Server URL item must have a value!
+errorSetConfigValue=Error setting config value!:
configChangesSubmitted=Configuration changes submitted.
-errorSetDataValue=Error Setting data values:
-errorCoolKeyGetStatus=coolkey.GetCoolKeyStatus() failed!
-errorCoolKeyRequiresAuth=coolkey.GetCoolKeyRequiresAuthentication() failed!
-errorCoolKeyIsAuth=coolkey.GetCoolKeyIsAuthenticated() failed!
-errorAuthCoolKey=coolkey.AuthenticateCoolKey failed!
-statusEnrolled=ENROLLED
-unknownIssuer=Unknown Issuer
-redHatUser=Red Hat User
-statusUnknown=Unknown
-errorNone=Operation Completed Successfully.
-serverError=Server Error.
-errorProblemResetTokenPin=Problem resetting token's pin.
-errorTokenEnrollment=Token Enrollment Error.
-errorCommCA=Error communicating with the Certificate Authority, try again later.
-errorInternalServer=Internal Server Error.
-errorResetPin=Error resetting the token's pin.
-errorInternalServer=Internal Server Error.
-errorAuthFailure=Authentication Failure, Try Again.
-errorTokenDisabled=Token is disabled, contact technical support.
-errorProblemCommToken=Problem communicating with the token.
-errorTokenUpgrade=Cannot upgrade token software.
-errorInvalidTokenType=Invalid token type.
-errorCannotPublish=Cannot publish.
-errorCommTokenDB=Cannot communicate with token database, try again later.
-errorTokenDisabled=Token is disabled, contact techincal support.
-errorPinReset=Cannot reset pin value for the token, contact technical support.
-errorConnLost=Connection to server lost.
-errorEntryTokenDB=Can not create entry for token in database, contact technical support.
-errorNoTokenState=No such token state, contact technical support.
-errorInvalidLostTokenReason=Invalid lost token reason, contact technical support.
-errorTokenUnusable=Token unusable due to compromise,contact technical support.
-errorNoInactiveToken=No such inactive token, contact technical support.
-errorProcessMultiTokens=Can not process more than one active token.
-errorKeyRecoveryProcessed=Key Recovery has been processed.
-errorKeyRecoveryFailed=Key Recovery failed, contact technical support.
-errorNoOperateLostToken=Can not operate on token reported lost, contact technical support.
-errorKeyArchival=Key archival error, contact technical support.
-errorConnTKS=Problem connecting to the TKS, contact technical support.
-errorFailUpdateTokenDB=Failed to update token database, contact technical support.
-errorCertRevocation=Internal certificate revocation error,contact technical support.
-errorNotOwnToken=User does not own this token, contact technical support.
-errorESCMisconfigured=ESC has been misconfigured, reconfigure and try again.
-errorESCNoCommCardReader=ESC can't communicate with card reader.
-errorESCNoTokenSession=ESC can't initiate session with token.
-errorESCNoTalkTPS=ESC can't talk to TPS.
-errorESCNoTalkTokenReader=ESC can't talk to token reader.
-
-
+errorSetDataValue=Error Setting data values:
+errorCoolKeyGetStatus=coolkey.GetCoolKeyStatus() failed!
+errorCoolKeyGetPolicy=coolkey.GetCoolKeyPolicy() failed!
+errorCoolKeyRequiresAuth=coolkey.GetCoolKeyRequiresAuthentication() failed!
+errorCoolKeyIsAuth=coolkey.GetCoolKeyIsAuthenticated() failed!
+errorCoolKeyCertNicknames=coolkey.GetCoolKeyCertNicknames() failed!
+errorAuthCoolKey=coolkey.AuthenticateCoolKey failed!
+errorCoolKeyCertInfo=coolkey.GetCoolKeyCertInfo() failed!
+errorGetAvailCoolKeys=coolkey.GetAvailableCoolKeys() failed!
+errorEnollCoolKey=coolkey.EnrollCoolKey() failed!
+errorCoolKeyIsEnrolled=coolkey.GetCoolKeyIsEnrolled failed!
+errorResetCoolKeyPIN=coolkey.ResestCoolKeyPIN() failed! Make sure Smart card is properly Enrolled.
+errorFormatCoolKey=coolkey.FormatCoolKey() failed!
+errorCancelCoolKey=coolkeyCancelCoolKeyOperation() failed!
+errorBlinkCoolKey=coolkey.BlinkCoolKey() failes!
+noCurrentlySelectedToken=No currently selected smart card!
+errorProvideScreenName=You must provide a valid screen name!
+errorProvideTokenPIN=You must provide a valid TokenPIN!
+errorMatchPinValues=The PIN values you entered don't match!
+errorValidUserPassword=You must provide a valid User Password!
+errorSelectKey=Please select a smart card.
+errorEnrolledFirst=Smart card must be enrolled first! Enroll card and try again.
+enrollmentFor=Enrollment for
+wasSuccessful=was successful.
+pinResetSuccessful=Password Reset was successfull!
+formatOf=Format of
+error=Error
+serverResponse= \n\n Server Response:
+enrollmentOfKey=Enrollment of smart card
+formatingOfKey=Formatting of smart card
+pinResetOfKey=PIN Reset for smart card
+operationForKey=Operation for smart card
+failed=failed.
+cancelled=cancelled.
+errorFindESCPlatform=Unable to determine Smart Card Manager platform.
+errorIssuerInfo=Error obtaining Issuer Info for key.
+#Strings for TRAY.j
+errorTrayIsInitialized=Can't determine if Icon component is already intialized!
+errorShowAllWindows=Error Showing All Windows:
+errorHideAllWindows=Error Hiding all Windows:
+errorShowWindow=Error Showing Window:
+errorHideWindow=Error Hiding Window:
+errorRemoveWindow=Error Removing Window:
+errorTrayNotification=Error Sending Tray notification:
+#Strings for GenericAuth.js
+value=Value
+mustMatch=must match
+mustHaveValue=Must have value set for field:
+noParentWindow=No parent window.
+authDialogNoParent=Auth dialog has no parent!
From fedora-directory-commits at redhat.com Wed Sep 13 17:56:52 2006
From: fedora-directory-commits at redhat.com (Jack Magne (jmagne))
Date: Wed, 13 Sep 2006 10:56:52 -0700
Subject: [Fedora-directory-commits] esc/src/app/xul/esc/chrome/content/esc
ESC.js, 1.1.1.1, 1.2 GenericAuth.js, 1.1.1.1, 1.2 TRAY.js,
1.1.1.1, 1.2 certinfo.xul, 1.1.1.1, 1.2 config.xul, 1.1.1.1,
1.2 esc.css, 1.1.1.1, 1.2 esc.xul, 1.1.1.1,
1.2 esc_browser.xul, 1.1.1.1, 1.2 settings.xul, 1.1.1.1, 1.2
Message-ID: <200609131756.k8DHuqOp012991@cvs-int.fedora.redhat.com>
Author: jmagne
Update of /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12965
Modified Files:
ESC.js GenericAuth.js TRAY.js certinfo.xul config.xul esc.css
esc.xul esc_browser.xul settings.xul
Log Message:
Update to Latest.
View full diff with command:
/usr/bin/cvs -f diff -kk -u -N -r 1.1.1.1 -r 1.2 ESC.js
Index: ESC.js
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/ESC.js,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- ESC.js 12 Jun 2006 23:39:51 -0000 1.1.1.1
+++ ESC.js 13 Sep 2006 17:56:49 -0000 1.2
@@ -20,21 +20,42 @@
var gStringBundle = null;
var netkey;
-var gHidden = null;
-
var keyUITable = new Array();
var keyTypeTable = new Array();
var curChildWindow = null;
-var gUsesTree = 0;
+var gEnrollmentPage = 0;
+var gAdminPage = 0;
+var gUsesListBox = 0;
+var gFactoryMode = 0;
+var gHiddenPage = 0;
+var gHiddenPageDone = 0;
+var gExternalUI = 0;
+
+var gDiagnosticsCopyString=null;
loadStringBundle();
+//ESC constants
+
+const KEY_ISSUER_URL = "keyIssuerUrl";
+const KEY_ISSUER = "keyIssuer";
+const TPS_URL = "Operation";
+const TPS_UI = "UI";
+const SERVICES_TAG = "Services";
+const ISSUER_TAG = "IssuerName";
+const SERVICE_INFO_TAG = "ServiceInfo";
+
+//Window names
+
+const ENROLL_WINDOW = "esc.xul";
+const ADMIN_WINDOW = "settings.xul";
+const HIDDEN_WINDOW = "hiddenWindow.xul";
+
function getUIForKey(aKeyID)
{
return keyUITable[aKeyID];
-
}
function getTypeForKey(aKeyID)
@@ -60,7 +81,7 @@
if(!iid.equals(Components.interfaces.rhIKeyNotify) &&
!iid.equals(Components.interfaces.nsISupports))
{
- alert(getBundleString("errorJsNotifyInterface"));
+ MyAlert(getBundleString("errorJsNotifyInterface"));
throw Components.results.NS_ERROR_NO_INTERFACE;
}
return this;
@@ -77,7 +98,7 @@
gNotify = new jsNotify;
netkey.rhCoolKeySetNotifyCallback(gNotify);
} catch(e) {
- alert(getBundleString("errorUniversalXPConnect") + e);
+ MyAlert(getBundleString("errorUniversalXPConnect") + e);
}
//
@@ -86,13 +107,14 @@
function cleanup()
{
- TrayRemoveWindow();
+ TrayRemoveWindow(null);
try {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
netkey.rhCoolKeyUnSetNotifyCallback(gNotify);
} catch(e) {
- alert(getBundleString("errorUniversalXPConnect") + e);
+ MyAlert(getBundleString("errorUniversalXPConnect") + e);
}
+
}
var gScreenName = "";
@@ -181,7 +203,7 @@
} catch(e) {
- alert(getBundleString("errorConfigValue") + e);
+ MyAlert(getBundleString("errorConfigValue") + e);
}
if(tps_uri)
@@ -193,6 +215,102 @@
}
+function DoPhoneHome(keyType,keyID)
+{
+ var callback = function (aResult) {
+
+ if(aResult == true)
+ {
+ UpdateRowWithPhoneHomeData(keyType,keyID);
+ }
+ else
+ {
+ launchCONFIG(keyType,keyID);
+ }
+ }
+
+ if(IsPhoneHomeCached(keyID))
+ {
+ return true;
+ }
+
+ var home = DoCoolKeyGetIssuerUrl(keyType,keyID);
+
+ var homeRes = false;
+
+ if(home)
+ {
+ homeRes = phoneHome(home,keyID,callback);
+ }
+
+ if(!homeRes)
+ {
+ launchCONFIG(keyType,keyID);
+ }
+
+ return homeRes;
+}
+//Test Phone Home url in config UI
+
+function DoPhoneHomeTest()
+{
+ // Test out user supplied phone home url
+
+ var name = this.name;
+
+ var callback = function (aResult) {
+
+ if(aResult == true)
+ {
+ MyAlert(getBundleString("tpsConfigSuccess"));
+ }
+ else
+ {
+ MyAlert(getBundleString("tpsConfigError"));
+ }
+ }
+
+ var url = document.getElementById("phonehomeuri");
+
+ if(!url)
+ {
+ MyAlert(getBundleString("noTpsConfigUrl"));
+ return;
+
+ }
+
+ if(!url.value)
+ {
+ MyAlert(getBundleString("noTpsConfigUrl"));
+ return;
+ }
+
+ MyAlert(getBundleString("tpsConfigTest") + " " + url.value);
+
+ if(name)
+ {
+ phoneHome(url.value,name,callback);
+ }
+ else
+ {
+ MyAlert(getBundleString("tpsConfigError"));
+ }
+
+}
+
+function DoPhoneHomeConfigClose()
+{
+
+ var name = this.name;
+
+ if(window.opener && name)
+ {
+ window.opener.UpdateRowWithPhoneHomeData(1,name);
+ }
+
+ window.close();
+}
+
//Test the tps uri connection
[...3381 lines suppressed...]
+ return false;
+ }
+ var root = response.getElementsByTagName("ServiceInfo");
+
+ if(!root)
+ {
+ if(resultCB)
+ resultCB(false);
+ return false;
+ }
+
+ var issuer = response.getElementsByTagName("IssuerName").item(0);
+
+ if(!issuer)
+ {
+ if(resultCB)
+ resultCB(false);
+ return false;
+ }
+
+ var theIssuer = issuer.lastChild.data;
+
+ if(theIssuer)
+ {
+ var issuer_config_value = ConfigValueWithKeyID(aKeyID,KEY_ISSUER);
+ if(issuer_config_value)
+ {
+ DoCoolKeySetConfigValue(issuer_config_value,theIssuer);
+
+ }
+ }
+
+ var services = response.getElementsByTagName("Services");
+
+ if(!services)
+ {
+ if(resultCB)
+ resultCB(false);
+ return false;
+ }
+
+ var servicesNodes = services[0].childNodes;
+ var len = servicesNodes.length;
+
+ for (var i = 0; i < len; i++)
+ {
+ var oChild = servicesNodes.item(i);
+ var name = oChild.nodeName;
+ var value = oChild.firstChild.data;
+
+ if(name && value)
+ {
+ var cValue = ConfigValueWithKeyID(aKeyID,name);
+
+ if(cValue)
+ {
+ DoCoolKeySetConfigValue(cValue,value);
+ }
+ }
+
+ }
+
+ if(resultCB)
+ {
+ //Manually write out entry for phone home url
+
+ var issuer_config_value = ConfigValueWithKeyID(aKeyID,KEY_ISSUER_URL);
+ var result = DoCoolKeySetConfigValue(issuer_config_value,url);
+ resultCB(true);
+ }
+ return;
}
+ }
- }
+ req.onreadystatechange = callback;
+ req.send(null);
+
+ return true;
+}
+
+function ReadESCLog()
+{
+
+ const logFileName = "esc.log";
+
+ // Get executable directory
+
+ var file = Components.classes["@mozilla.org/file/directory_service;1"]
+ .getService(Components.interfaces.nsIProperties)
+ .get("ProfD", Components.interfaces.nsIFile);
+
+ file = file.parent;
+ file.append(logFileName);
+ var istream = Components.classes["@mozilla.org/network/file-input-stream;1"]
+ .createInstance(Components.interfaces.nsIFileInputStream);
+
+ try {
+ istream.init(file, 0x01, 0444, 0);
+ istream.QueryInterface(Components.interfaces.nsILineInputStream);
+
+ } catch (e){
+
+ return null;
+ }
+
+ // read lines into array
+ var line = {}, lines = [], hasmore;
+ do {
+ hasmore = istream.readLine(line);
+
+ var value = line.value;
+
+ var colonIndex = value.indexOf(":");
+
+ value = value.substring(colonIndex + 1);
+
+ lines.push(value);
+ } while(hasmore);
+
+ istream.close();
+
+ return lines;
+
+}
+
+// Get the url form of the balloon tooltip icon
+// Only useful on Linux
+
+function GetESCNotifyIconPath(keyType,keyID)
+{
+ var path = null;
+ var def_image = "/components/icon.png";
+
+ var chrome_path = "/chrome/content/esc/";
+ var image = null;
+
+ var status;
+
+ try {
+ status = GetCoolKeyStatus(keyType, keyID);
+ } catch(e) {
+ status = 0;
+ }
+
+ if(status == 1) // no applet
+ {
+ image = chrome_path + "blank-card.png";
+ }
+ if(status == 2) // uninitialized
+ {
+ image = chrome_path + "initializecard.png";
+ }
+ if(status == 4) // enrolled
+ {
+ image = chrome_path + "enrolled-key.png";
+ }
+
+ if(!image)
+ image = def_image;
+
+ var file = Components.classes["@mozilla.org/file/directory_service;1"]
+ .getService(Components.interfaces.nsIProperties)
+ .get("CurProcD", Components.interfaces.nsIFile);
+
+ if(file)
+ file = file.parent;
+
+ if(file.path)
+ path = "file://" + file.path + image;
+
+ return path;
+}
+
+// New Alert Functions based on nsIPromptService
+
+function MyAlert(message)
+{
+ if(message)
+ DoMyAlert(message,getBundleString("escTitle"));
+}
+
+function DoMyAlert(message,title)
+{
+
+ if(!message || !title)
+ return; try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ var prompts = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService);
+
+ prompts.alert(window,title,message);
+
+ } catch(e) {
+
+
+ alert("Problem with nsIPromptService " + e);
+ }
}
Index: GenericAuth.js
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/GenericAuth.js,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- GenericAuth.js 12 Jun 2006 23:39:51 -0000 1.1.1.1
+++ GenericAuth.js 13 Sep 2006 17:56:49 -0000 1.2
@@ -430,6 +430,18 @@
return text_node;
}
+function AddSpacer()
+{
+ var tSpacer = document.createElement("spacer");
+
+ if(!tSpacer)
+ return null;
+
+
+ return tSpacer;
+
+}
+
function AddButton(id,label)
{
@@ -586,9 +598,15 @@
if(last_row)
{
+ AddSpacerToNode(last_row,"1","min-height: 20px");
+ AddSpacerToNode(last_row,"1","min-height: 20px");
var button = AddButton("","Submit");
- button.setAttribute("oncommand" , "FormSubmit();");
- last_row.appendChild(button);
+ if(button)
+ button.setAttribute("oncommand" , "FormSubmit();");
+
+
+ if(button)
+ last_row.appendChild(button);
}
}
Index: TRAY.js
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/TRAY.js,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- TRAY.js 12 Jun 2006 23:39:51 -0000 1.1.1.1
+++ TRAY.js 13 Sep 2006 17:56:49 -0000 1.2
@@ -23,9 +23,40 @@
var gBaseWindow = 0;
+var gWindNotify = null;
+
loadStringBundle();
+//
+// Tray event Notify callback
+//
+function jsWindNotify() {}
+
+jsWindNotify.prototype = {
+
+ rhTrayWindEventNotify: function(aEvent,aEventData,aKeyData,aData1,aData2)
+ {
+ //alert("rhTrayWindEventNotify!!!! event " + aEvent);
+
+ NotifyESCOfTrayEvent(aEvent,aEventData,aKeyData,aData1,aData2);
+ },
+
+ QueryInterface: function(iid)
+ {
+ //alert("iid: " + iid);
+ if(!iid.equals(Components.interfaces.rhITrayWindNotify) &&
+ !iid.equals(Components.interfaces.nsISupports))
+ {
+ MyAlert(getBundleString("errorJsNotifyInterface"));
+ throw Components.results.NS_ERROR_NO_INTERFACE;
+ }
+ return this;
+ }
+};
+
+
+
//Initialize tray XPCOM object
// GECKO ONLY initialization
@@ -39,10 +70,20 @@
gBaseWindow = getBaseWindow();
+ if(gTray)
+ {
+ gWindNotify = new jsWindNotify;
+ if(gWindNotify)
+ gTray.setwindnotifycallback(gWindNotify);
+
+ //alert("setting tray notify callback " + gWindNotify);
+ }
+
} catch(e) {
-}
+ MyAlert("e " + e);
+}
TrayAddWindow();
@@ -92,7 +133,7 @@
}
catch (ex)
{
- alert(getBundleString("errorTrayIsInitialized"));
+ MyAlert(getBundleString("errorTrayIsInitialized"));
rv = null;
/* ignore no-interface exception */
}
@@ -115,7 +156,7 @@
gTray.showall();
} catch(e) {
- alert(getBundleString("errorShowAllWindows") + e);
+ MyAlert(getBundleString("errorShowAllWindows") + e);
return;
}
@@ -135,7 +176,7 @@
gTray.hideall();
} catch(e) {
- alert(getStringBundle("errorHideAllWindows") + e);
+ MyAlert(getStringBundle("errorHideAllWindows") + e);
return;
}
@@ -156,7 +197,7 @@
gTray.show(gBaseWindow);
} catch(e) {
- alert(getBundleString("errorShowWindow"));
+ MyAlert(getBundleString("errorShowWindow"));
return;
}
@@ -176,30 +217,50 @@
gTray.hide(gBaseWindow);
} catch(e) {
- alert(getBundleString("errorHideWindow"));
+ MyAlert(getBundleString("errorHideWindow"));
return;
}
}
-function TrayRemoveWindow()
+function TrayRemoveWindowNotify()
{
- if(gTray && gBaseWindow)
+ if(gTray && gBaseWindow && gWindNotify)
{
-
try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+
+ gTray.unsetwindnotifycallback(gWindNotify);
+
+
+ } catch(e) {
+ return;
+ }
+
+
+ }
+}
+
+function TrayRemoveWindow(doPreserveNotifyCallback)
+{
+ if(gTray && gBaseWindow)
+ {
+ try {
+
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
gTray.remove(gBaseWindow);
} catch(e) {
- alert(getBundleString("errorRemoveWindow") + e);
+ MyAlert(getBundleString("errorRemoveWindow") + e);
return;
}
+ if(gWindNotify && !doPreserveNotifyCallback)
+ gTray.unsetwindnotifycallback(gWindNotify);
}
}
@@ -226,38 +287,88 @@
}
+}
+function TraySendNotificationMessage(aTitle,aMessage,aSeverity,aTimeout,aIcon)
+{
+ if(!gHiddenPage)
+ return;
+
+ if(gTray && gBaseWindow)
+ {
+ try {
-}
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")
-function TraySendNotificationMessage(aMessage)
-{
+ gTray.sendnotification(aTitle,aMessage,aSeverity,aTimeout,aIcon);
- if(gTray && gBaseWindow)
+ } catch(e) {
+ alert(getBundleString("errorTrayNotification") + e);
+ return;
+ }
+
+ }
+
+}
+
+
+function TrayHideNotificationIcon()
{
+ if(!gHiddenPage)
+ return;
- try {
+ if(gTray && gBaseWindow)
+ {
- netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")
- gTray.sendnotification(aMessage);
+ gTray.hideicon();
} catch(e) {
- alert(getBundleString("errorTrayNotification") + e);
return;
}
+ }
}
+function TrayLoadedOK()
+{
+ var result = 0;
+ if(gTray)
+ result = 1;
+ return result;
+}
+
+function TrayShowNotificationIcon()
+{
+ if(!gHiddenPage)
+ return;
+
+ if(gTray && gBaseWindow)
+ {
+
+ try {
+
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")
+ gTray.settooltipmsg(getBundleString("escTitle"));
+ gTray.showicon();
+
+ } catch(e) {
+ return;
+ }
+
+ }
}
+
//String bundling related functions
function loadStringBundle()
@@ -267,7 +378,6 @@
function getBundleString(string_id)
{
-
var str = null;
if(!string_id || !gStringBundle)
@@ -276,6 +386,5 @@
str = gStringBundle.getString(string_id);
return str;
-
}
Index: certinfo.xul
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/certinfo.xul,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- certinfo.xul 12 Jun 2006 23:39:51 -0000 1.1.1.1
+++ certinfo.xul 13 Sep 2006 17:56:49 -0000 1.2
@@ -20,7 +20,7 @@
-
-
-
-
-
-
+
-
+
-
-
-
+
+ &tpsConfigDesc;
+
+
-
@@ -64,24 +52,16 @@
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
Index: esc.css
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/esc.css,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- esc.css 12 Jun 2006 23:39:51 -0000 1.1.1.1
+++ esc.css 13 Sep 2006 17:56:49 -0000 1.2
@@ -15,11 +15,27 @@
* All rights reserved.
* END COPYRIGHT BLOCK **/
+p {
+
+ font-style: italic;
+}
+
+.invisibleWindow {
+
+ visibility: hidden ;
+
+}
.escwindow {
background: #ffffff url(bg.jpg) repeat-x;
font-family: arial;
font-size: 17pt;
+ padding: 10px;
+}
+
+#smallKeyImage {
+
+ list-style-image: url(esc-client-24.png);
}
#logoImage {
@@ -27,13 +43,80 @@
list-style-image: url(logo.gif);
}
+#cylonImage {
+
+ list-style-image: url(progress.7.gif);
+}
+
+#blankKeyImage {
+
+ list-style-image: url(blank-card.png);
+}
+
+#uninitializedKeyImage {
+ list-style-image: url(initializecard.png);
+}
+
+#enrolledKeyImage {
+
+ list-style-image: url(enrolled-key.png);
+}
+
+#passwordNone {
+ list-style-image: url(1-none.png);
+}
+
* {
font-family: "Arial";
font-size: 8pt;
}
+
+.logoBox {
+ margin: 5px;
+ padding: 5px;
+
+}
+
+.outerBoxMedium {
+
+ padding: 5px;
+
+}
+.outerGroupBox {
+ padding: 7px;
+}
+
+.messageText {
+ font-size: 9pt;
+ text-align: justify;
+
+}
+
+.captionText {
+ font-size: 11pt;
+}
+
+.boldMessageText {
+ font-size: 1.3em;
+ font-weight: bold;
+ text-align: justify;
+
+}
+
+.largeLabelText {
+ font-size: 20pt;
+ font-weight:bold;
+}
+
+.mediumLabelText {
+ font-size: 12pt;
+ font-weight:bold;
+ text-align: center;
+}
+
.headLabelText {
- font-size: 13pt;
+ font-size: 17pt;
font-weight:bold;
text-align: center;
}
@@ -44,6 +127,12 @@
font-weight: bold;
}
+.largeLabelText {
+
+ font-size: 13pt;
+ font-weight:bold;
+}
+
.rowLabelTextUninit {
font-size: 8pt;
@@ -54,25 +143,45 @@
}
.rowLabelText {
-
font-size: 8pt;
- font-weight: bold;
-
+ font-weight: normal;
}
.headerText {
- font-family: "Arial";
font-size: 12pt;
font-weight: bold;
}
+.buttonText {
+ font-size: 10pt;
+}
+
.verticalSpacer {
- min-height: 20px;
+ min-height: 2.0em;
}
+.progressMeter {
+ margin: 4px;
+ width: 12px;
+}
+
+.verticalSpacerShort {
+ min-height: 1em;
+}
+
+
+.horSpacerShort {
+
+ min-width: 2em;
+}
+
+.horSpacerVeryShort {
+ min-width: 1em;
+}
+
.authTitleText {
text-align: left;
@@ -101,7 +210,7 @@
.linkText {
font-family: "Arial";
- font-size: 8pt;
+ font-size: 1.2em;
}
#BindingTable {
@@ -120,6 +229,10 @@
font-size: 7pt;
}
+tr [COOLKeyPresent="yes"]{
+ background-color: rgb(255, 0, 0);
+}
+
.cylon {
font-size: 4pt;
position: relative;
@@ -131,15 +244,12 @@
width: 200px;
height: 20px;
- align: center;
}
.cylonEye {
-
- align: center;
font-weight: bold;
- font-size: 9pt;
+ font-size: 4pt;
}
#statusMsg {
@@ -148,7 +258,7 @@
.ProgressMeter {
position: relative;
- padding: 0px;
+ padding: 1px;
border: 1px solid rgb(60, 60, 60);
background-color: #ffffff;
text-align: center;
@@ -172,42 +282,11 @@
}
-.KeyTableHeader {
- color: rgb(0,0, 0);
- background-color: #ffffff;
- text-align: left;
-}
-#KeyTable td {
- background-color: #ffffff;
- padding-left: 3px;
- padding-right: 3px;
-};
-
-.TableDescriptionPanel {
- background-color: #ffffff);
- margin-right: 5px;
- margin-left: 5px;
- margin-bottom: 0px;
- margin-bottom: 5px;
- padding: 5px;
-}
-
-.PurchasePanel {
- width: 100%;
- text-align: center;
- padding-top: 5px;
- padding-bottom: 5px;
-}
-
-.NeedQuestionText {
- font-size: 16pt;
- font-weight: bold;
-}
-
.COOLHeaderText {
font-family: "Arial";
- font-size: 20pt;
+ font-size: 17pt;
font-weight: bold;
+ vertical-align: middle;
}
.ContentTable {
@@ -230,24 +309,38 @@
.PageHeader {
width: 100%;
border-bottom: solid black 1px;
- vertical-align: center;
+ vertical-align: middle;
background-color: #ffffff;
}
-.Bordered {
+.BorderedIFrame {
- border: grey solid 7px;
+ width: 600px;
+ height: 725px;
+ border: black solid 4px;
}
.SelectedRow {
- background-color: grey;
+ color: white;
+ background-color: #0033CC;
}
.UnSelectedRow {
+ color: black;
background-color: #ffffff;
}
+
+.mediumButton {
+ width: 100px;
+}
+
+.mediumWideBox {
+
+ min-width: 20em;
+
+}
Index: esc.xul
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/esc.xul,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- esc.xul 12 Jun 2006 23:39:51 -0000 1.1.1.1
+++ esc.xul 13 Sep 2006 17:56:49 -0000 1.2
@@ -22,104 +22,143 @@
class="escwindow"
id="esc-window"
title="&escTitle;"
- onload="InitializeBindingTable()"
- width ="500"
+ onload="InitializeEnrollment()"
+ width ="600"
height= "350"
onunload="cleanup()"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ &detectedMessage;
+
+
+ &enrollMessage;
+
+
+
+ &noKey;
+
+
+
+ &insertKey;
+
+
+
+
+
+
+ &readyToProceed;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
Index: esc_browser.xul
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/esc_browser.xul,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- esc_browser.xul 12 Jun 2006 23:39:51 -0000 1.1.1.1
+++ esc_browser.xul 13 Sep 2006 17:56:49 -0000 1.2
@@ -1,58 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Index: settings.xul
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/settings.xul,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- settings.xul 12 Jun 2006 23:39:51 -0000 1.1.1.1
+++ settings.xul 13 Sep 2006 17:56:49 -0000 1.2
@@ -20,136 +20,133 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ &administerMessage;
+
+
+
+
+
+
+
+
+ &adminNoKeysMessage;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ &adminDetailsMessage;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From fedora-directory-commits at redhat.com Wed Sep 13 17:57:40 2006
From: fedora-directory-commits at redhat.com (Jack Magne (jmagne))
Date: Wed, 13 Sep 2006 10:57:40 -0700
Subject: [Fedora-directory-commits] esc/src/app/xul/esc/chrome/content/esc
1-none.png, NONE, 1.1 2-vweak.png, NONE, 1.1 3-weak.png, NONE,
1.1 4-fair.png, NONE, 1.1 5-good.png, NONE, 1.1 6-strong.png,
NONE, 1.1 blank-card.png, NONE, 1.1 blank-cardx2.png, NONE,
1.1 enrolled-key.png, NONE, 1.1 enrolled-keyx2.png, NONE,
1.1 enroll.png, NONE, 1.1 enrollx2.png, NONE,
1.1 esc-client-24.png, NONE, 1.1 esc.png, NONE,
1.1 formatcard.png, NONE, 1.1 formatcardx2.png, NONE,
1.1 initializecard.png, NONE, 1.1 initializecardx2.png, NONE, 1.1
Message-ID: <200609131757.k8DHves1013047@cvs-int.fedora.redhat.com>
Author: jmagne
Update of /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv13014
Added Files:
1-none.png 2-vweak.png 3-weak.png 4-fair.png 5-good.png
6-strong.png blank-card.png blank-cardx2.png enrolled-key.png
enrolled-keyx2.png enroll.png enrollx2.png esc-client-24.png
esc.png formatcard.png formatcardx2.png initializecard.png
initializecardx2.png
Log Message:
Initial revison
From fedora-directory-commits at redhat.com Wed Sep 13 17:59:44 2006
From: fedora-directory-commits at redhat.com (Jack Magne (jmagne))
Date: Wed, 13 Sep 2006 10:59:44 -0700
Subject: [Fedora-directory-commits] esc/src/app/xul/esc/chrome/content/esc
hiddenWindow.xul, NONE, 1.1
Message-ID: <200609131759.k8DHxiVZ013084@cvs-int.fedora.redhat.com>
Author: jmagne
Update of /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv13068
Added Files:
hiddenWindow.xul
Log Message:
Initial revision.
--- NEW FILE hiddenWindow.xul ---
From fedora-directory-commits at redhat.com Wed Sep 13 18:01:06 2006
From: fedora-directory-commits at redhat.com (Jack Magne (jmagne))
Date: Wed, 13 Sep 2006 11:01:06 -0700
Subject: [Fedora-directory-commits] esc/src/app/xul/esc/chrome/content/esc
AdvancedInfo.js, NONE, 1.1
Message-ID: <200609131801.k8DI163F015556@cvs-int.fedora.redhat.com>
Author: jmagne
Update of /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv13121
Added Files:
AdvancedInfo.js
Log Message:
Initial revision.
--- NEW FILE AdvancedInfo.js ---
/** 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 **/
function ShowAdvancedInfo()
{
var dump = window.arguments[0];
var frame = window.document.getElementById("advanced-info");
var doco = frame.contentDocument;
if(doco)
{
doco.open();
doco.write(dump);
doco.close();
}
}
From fedora-directory-commits at redhat.com Wed Sep 13 18:02:24 2006
From: fedora-directory-commits at redhat.com (Jack Magne (jmagne))
Date: Wed, 13 Sep 2006 11:02:24 -0700
Subject: [Fedora-directory-commits] esc/src/app/xul/esc/chrome/content/esc
progress.7.gif, NONE, 1.1 throbber-anim5.gif, NONE, 1.1
Message-ID: <200609131802.k8DI2Om2015908@cvs-int.fedora.redhat.com>
Author: jmagne
Update of /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv15891
Added Files:
progress.7.gif throbber-anim5.gif
Log Message:
Initial revison
From fedora-directory-commits at redhat.com Wed Sep 13 18:03:52 2006
From: fedora-directory-commits at redhat.com (Jack Magne (jmagne))
Date: Wed, 13 Sep 2006 11:03:52 -0700
Subject: [Fedora-directory-commits] esc/src/lib/notifytray - New directory
Message-ID: <200609131803.k8DI3qZj015951@cvs-int.fedora.redhat.com>
Author: jmagne
Update of /cvs/dirsec/esc/src/lib/notifytray
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv15936/notifytray
Log Message:
Directory /cvs/dirsec/esc/src/lib/notifytray added to the repository
From fedora-directory-commits at redhat.com Wed Sep 13 18:06:11 2006
From: fedora-directory-commits at redhat.com (Jack Magne (jmagne))
Date: Wed, 13 Sep 2006 11:06:11 -0700
Subject: [Fedora-directory-commits] esc/src/lib/notifytray config.mk, NONE,
1.1 Makefile, NONE, 1.1 manifest.mn, NONE,
1.1 notifyareaicon.c, NONE, 1.1 notifyareaicon.h, NONE,
1.1 notify.def, NONE, 1.1 notifytray.c, NONE, 1.1 notifytray.h,
NONE, 1.1
Message-ID: <200609131806.k8DI6BKm016040@cvs-int.fedora.redhat.com>
Author: jmagne
Update of /cvs/dirsec/esc/src/lib/notifytray
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv16017
Added Files:
config.mk Makefile manifest.mn notifyareaicon.c
notifyareaicon.h notify.def notifytray.c notifytray.h
Log Message:
Initial revision.
--- NEW FILE config.mk ---
# ***** 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 *****
TARGETS = $(LIBRARY)
#SHARED_LIBRARY =
#IMPORT_LIBRARY =
#PROGRAM =
--- NEW FILE Makefile ---
#! 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) #
#######################################################################
DEFINES += -DDLL_PREFIX=\"$(DLL_PREFIX)\"
DEFINES += -DDLL_SUFFIX=\"$(DLL_SUFFIX)\"
#######################################################################
# (4) Include "local" platform-dependent assignments (OPTIONAL). #
#######################################################################
include config.mk
ifeq ($(HAVE_LIB_NOTIFY),1)
CFLAGS += -DHAVE_LIB_NOTIFY
endif
#######################################################################
# (5) Execute "global" rules. (OPTIONAL) #
#######################################################################
include $(CORE_DEPTH)/coreconf/rules.mk
#######################################################################
# (6) Execute "component" rules. (OPTIONAL) #
#######################################################################
#######################################################################
# (7) Execute "local" rules. (OPTIONAL). #
#######################################################################
pig:
echo "HAVE_LIB_NOTIFY" $(HAVE_LIB_NOTIFY)
echo "CFLAGS" + $(CFLAGS)
--- NEW FILE manifest.mn ---
# 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 = ../../..
DEFINES += $(shell pkg-config --cflags gtk+-2.0)
CCFLAGS += $(shell pkg-config --libs gtk+-2.0)
CCFLAGS += $(shell pkg-config --cflags glib-2.0)
ifeq ($(HAVE_LIB_NOTIFY),1)
LDFLAGS += $(shell pkg-config --libs libnotify)
REQUIRES = libnotify
endif
MODULE = traynotify
LIBRARY_NAME = $(MODULE)
MAPFILE = $(OBJDIR)/notify.def
CSRCS = \
notifytray.c \
notifyareaicon.c \
$(NULL)
EXPORTS = \
notifytray.h \
$(NULL)
--- NEW FILE notifyareaicon.c ---
/** 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 **/
#include
#include
#include "notifyareaicon.h"
#define SYSTEM_TRAY_REQUEST_DOCK 0
#define SYSTEM_TRAY_BEGIN_MESSAGE 1
#define SYSTEM_TRAY_CANCEL_MESSAGE 2
static void notify_area_icon_class_init(NotifyAreaIconClass *theClass);
static void notify_area_icon_init(NotifyAreaIcon *icon);
static void notify_area_icon_unrealize (GtkWidget *widget);
static void notify_area_icon_update_manager_wnd (NotifyAreaIcon *icon);
static GtkPlugClass *plug_parent_class = NULL;
GType
notify_area_icon_get_type (void)
{
static GType my_type = 0;
my_type = g_type_from_name("CoolKeyTrayIcon");
if (my_type == 0)
{
static const GTypeInfo my_info =
{
sizeof (NotifyAreaIconClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) notify_area_icon_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (NotifyAreaIcon),
0, /* n_preallocs */
(GInstanceInitFunc) notify_area_icon_init
};
my_type = g_type_register_static (GTK_TYPE_PLUG, "CoolKeyTrayIcon", &my_info,(GTypeFlags) 0);
}
else
{
if (plug_parent_class == NULL) {
notify_area_icon_class_init((NotifyAreaIconClass *)g_type_class_peek(my_type));
}
}
return my_type;
}
static void
notify_area_icon_init (NotifyAreaIcon *icon)
{
icon->counter = 1;
gtk_widget_add_events (GTK_WIDGET (icon), GDK_PROPERTY_CHANGE_MASK);
}
static void
notify_area_icon_class_init (NotifyAreaIconClass *theClass)
{
GtkWidgetClass *widget_klass = (GtkWidgetClass *)theClass;
plug_parent_class = (GtkPlugClass *) g_type_class_peek_parent (theClass);
widget_klass->unrealize = notify_area_icon_unrealize;
}
static void
notify_area_icon_unrealize (GtkWidget *widget)
{
NotifyAreaIcon *icon = (NotifyAreaIcon *) widget;
GdkWindow *root_window;
g_print("notify_area_icon_unrealize \n");
if (icon->manager_wnd != None)
{
GdkWindow *gdkwin;
gdkwin = gdk_window_lookup (icon->manager_wnd);
}
root_window = gdk_window_lookup (gdk_x11_get_default_root_xwindow ());
if (GTK_WIDGET_CLASS (plug_parent_class)->unrealize)
(* GTK_WIDGET_CLASS (plug_parent_class)->unrealize) (widget);
}
static void
notify_area_icon_send_manager_msg (NotifyAreaIcon *icon,
long message,
Window window,
long data1,
long data2,
long data3)
{
XClientMessageEvent ev;
Display *display;
g_print("notify_area_icon_send_manager_msg \n");
ev.type = ClientMessage;
ev.window = window;
ev.message_type = icon->system_tray_opcode_atom;
ev.format = 32;
ev.data.l[0] = gdk_x11_get_server_time (GTK_WIDGET (icon)->window);
ev.data.l[1] = message;
ev.data.l[2] = data1;
ev.data.l[3] = data2;
ev.data.l[4] = data3;
display = gdk_display;
gdk_error_trap_push ();
XSendEvent (display,
icon->manager_wnd, False, NoEventMask, (XEvent *)&ev);
XSync (display, False);
gdk_error_trap_pop ();
}
static void
notify_area_icon_send_dock_request (NotifyAreaIcon *icon)
{
g_print("notify_area_icon_send_dock_request \n");
notify_area_icon_send_manager_msg (icon,
SYSTEM_TRAY_REQUEST_DOCK,
icon->manager_wnd,
gtk_plug_get_id (GTK_PLUG (icon)),
0, 0);
}
static void
notify_area_icon_update_manager_wnd(NotifyAreaIcon *icon)
{
Display *xdisplay;
xdisplay = gdk_display;
if (icon->manager_wnd != None)
{
GdkWindow *gdkwin;
gdkwin = gdk_window_lookup (icon->manager_wnd);
}
XGrabServer (xdisplay);
icon->manager_wnd = XGetSelectionOwner (xdisplay, icon->selection_atom);
if (icon->manager_wnd != None)
XSelectInput (xdisplay,
icon->manager_wnd, StructureNotifyMask);
XUngrabServer (xdisplay);
XFlush (xdisplay);
if (icon->manager_wnd != None)
{
GdkWindow *gdkwin;
gdkwin = gdk_window_lookup (icon->manager_wnd);
g_print("update_manager_wnd gdkwin %p \n",gdkwin);
/* Send dock request */
notify_area_icon_send_dock_request (icon);
}
}
NotifyAreaIcon *
notify_area_icon_new(const gchar *name)
{
NotifyAreaIcon *icon;
char buff[256];
GdkWindow *root;
Screen *xscreen = DefaultScreenOfDisplay (gdk_display);
g_return_val_if_fail (xscreen != NULL,NULL);
g_print("notify_area_icon_new_for_xscreen \n");
icon = (NotifyAreaIcon *) g_object_new(notify_area_icon_get_type ()
, NULL);
gtk_window_set_title (GTK_WINDOW (icon), name);
gtk_plug_construct (GTK_PLUG (icon), 0);
gtk_widget_realize (GTK_WIDGET (icon));
g_snprintf (buff, sizeof (buff),
"_NET_SYSTEM_TRAY_S%d",
XScreenNumberOfScreen (xscreen));
icon->selection_atom = XInternAtom (DisplayOfScreen (xscreen),
buff, False);
icon->system_tray_opcode_atom = XInternAtom (DisplayOfScreen (xscreen),
"_NET_SYSTEM_TRAY_OPCODE", False);
notify_area_icon_update_manager_wnd(icon);
root = gdk_window_lookup (gdk_x11_get_default_root_xwindow ());
icon->tooltips = gtk_tooltips_new ();
return icon;
}
guint
notify_area_icon_send_msg (NotifyAreaIcon *icon,
gint timeout,
const char *message,
gint msg_len)
{
guint counter;
g_print("notify_area_tray_icon_send_msg \n");
g_return_val_if_fail (timeout >= 0, 0);
g_return_val_if_fail (message != NULL, 0);
if (icon->manager_wnd == None)
return 0;
int len = strlen(message);
counter = icon->counter++;
notify_area_icon_send_manager_msg (icon, SYSTEM_TRAY_BEGIN_MESSAGE,
(Window)gtk_plug_get_id (GTK_PLUG (icon)),
timeout, len, counter);
int message_chunk_size = 20;
gdk_error_trap_push ();
/* Send the message in chunks of 20*/
while (len > 0)
{
XClientMessageEvent ev;
Display *xdisplay;
xdisplay = GDK_DISPLAY_XDISPLAY (gtk_widget_get_display (GTK_WIDGET (icon)));
ev.type = ClientMessage;
ev.window = (Window)gtk_plug_get_id (GTK_PLUG (icon));
ev.format = 8;
ev.message_type = XInternAtom (xdisplay,
"_NET_SYSTEM_TRAY_MESSAGE_DATA", False);
if (len > message_chunk_size)
{
memcpy ((char *)&ev.data, message, message_chunk_size);
len -= message_chunk_size;
message += message_chunk_size;
}
else
{
memcpy ((char *)&ev.data, message, len);
len = 0;
}
XSendEvent (xdisplay,
icon->manager_wnd, False, StructureNotifyMask, (XEvent *)&ev);
XSync (xdisplay, False);
}
gdk_error_trap_pop ();
return counter;
}
--- NEW FILE notifyareaicon.h ---
/** 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 _NOTIFY_AREA_ICON_H
#define _NOTIFY_AREA_ICON_H
#include
#include
#include
G_BEGIN_DECLS
struct _NotifyAreaIcon
{
GtkPlug parent;
guint counter;
Atom selection_atom;
Atom system_tray_opcode_atom;
Window manager_wnd;
GtkTooltips *tooltips;
};
struct _NotifyAreaIconClass
{
GtkPlugClass parent_class;
};
typedef struct _NotifyAreaIcon NotifyAreaIcon;
typedef struct _NotifyAreaIconClass NotifyAreaIconClass;
extern NotifyAreaIcon *notify_area_icon_new(const gchar *name);
guint notify_area_icon_send_msg(NotifyAreaIcon *icon,
gint timeout,
const char *msg,
gint length);
GType notify_area_icon_get_type (void);
G_END_DECLS
#endif /* NOTIFY_AREA_ICON_H */
--- NEW FILE notify.def ---
;+NOTIFY_1.0 { # NOTIFY release 1.0
;+ global:
LIBRARY notify ;-
EXPORTS ;-
notify_icon_create;
notify_icon_create_with_image_file;
notify_icon_destroy;
notify_icon_created_ok;
;+ local:
;+ *;
;+};
--- NEW FILE notifytray.c ---
/** 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 **/
#include
#include
#include "notifyareaicon.h"
#include "notifytray.h"
#include "string.h"
#ifdef HAVE_LIB_NOTIFY
#include
#endif
/* globals */
static NotifyAreaIcon *notify = NULL;
static GtkWidget *image = NULL;
static GdkPixbuf *blank_icon = NULL;
static GtkWidget *notify_menu = NULL;
static char *notify_image = NULL;
static GtkWidget *notify_box = NULL;
GtkWidget *notify_icon_get_box_widget()
{
return notify_box;
}
void
notify_icon_embedded_cb(GtkWidget *widget, void *data)
{
g_print ("notify_icon_embedded_cb\n");
}
void
notify_icon_destroyed_cb(GtkWidget *widget, void *data)
{
g_print ("notify_icon_destroyed_cb\n");
g_object_unref(G_OBJECT(notify));
notify = NULL;
}
void
notify_icon_clicked_cb_local(GtkWidget *button, GdkEventButton *event, void *data)
{
g_print ("notify_icon_clicked_cb_local.\n");
if(notify_menu)
{
g_print("trying to create popup menu. \n");
gtk_menu_popup(GTK_MENU(notify_menu),
NULL,
NULL,
NULL,
NULL,
event->button,
event->time);
}
if (event->type != GDK_BUTTON_PRESS)
return;
}
void
notify_icon_destroy()
{
g_print ("notify_icon_destroy\n");
if(notify == NULL)
{
return;
}
g_signal_handlers_disconnect_by_func(G_OBJECT(notify),(void *) G_CALLBACK(notify_icon_destroyed_cb),NULL);
gtk_widget_destroy(GTK_WIDGET(notify));
g_object_unref(G_OBJECT(notify));
notify = NULL;
if (blank_icon)
g_object_unref(G_OBJECT(blank_icon));
blank_icon = NULL;
}
void notify_icon_create_with_image_file(char *image_file)
{
if(notify_image)
{
free(notify_image);
notify_image = NULL;
}
notify_image = strdup(image_file);
notify_icon_create();
}
void
notify_icon_create()
{
if (notify) {
return;
}
notify = notify_area_icon_new("coolkey");
if(!notify_box)
{
notify_box = gtk_event_box_new();
}
if(notify_image)
{
g_print("about to create image from file %s \n",notify_image);
image = gtk_image_new_from_file(notify_image);
}
g_signal_connect(G_OBJECT(notify), "embedded", G_CALLBACK(notify_icon_embedded_cb), NULL);
g_signal_connect(G_OBJECT(notify), "destroy", G_CALLBACK(notify_icon_destroyed_cb), NULL);
gtk_container_add(GTK_CONTAINER(notify_box), image);
gtk_container_add(GTK_CONTAINER(notify), notify_box);
if(!gtk_check_version(2,4,0))
g_object_set(G_OBJECT(notify_box), "visible-window", FALSE, NULL);
gtk_widget_show_all(GTK_WIDGET(notify));
/* reference the icon */
g_object_ref(G_OBJECT(notify));
}
int notify_icon_created_ok()
{
if(!notify)
return 0;
if(notify->manager_wnd)
return 1;
else
return 0;
}
int notify_icon_show()
{
if(!notify)
return 0;
gtk_widget_show(GTK_WIDGET(notify));
return 1;
}
int notify_icon_hide()
{
if(!notify)
return 0;
gtk_widget_hide(GTK_WIDGET(notify));
return 1;
}
void notify_icon_set_static_tooltip(const gchar *message)
{
if(!message || !notify)
return;
if(notify->tooltips)
{
gtk_tooltips_set_tip (notify->tooltips, GTK_WIDGET(notify), message, NULL);
}
}
void notify_icon_send_tooltip_msg(const gchar *title,const gchar *message,gint severity,gint timeout,const char* icon)
{
if(!message || !notify)
return;
gchar *msg_title = NULL;
if(!title)
msg_title = "Notification";
else
msg_title = title;
gint msg_timeout = 3000;
if(timeout > 0 && timeout < 10000)
msg_timeout = timeout;
#ifdef HAVE_LIB_NOTIFY
if(!notify_is_initted())
{
notify_init ("ESC");
}
g_print("icon %s", icon);
NotifyNotification *not = notify_notification_new(msg_title, message,icon, GTK_WIDGET(notify));
if(not)
{
notify_notification_set_timeout (not, msg_timeout);
if(!notify_notification_show (not, NULL))
{
g_print ("problem showing notification");
}
g_object_unref(G_OBJECT(not));
}
else
{
g_print ("problem creating notification object!\n");
}
#endif
}
--- NEW FILE notifytray.h ---
/** 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 _NOTIFY_TRAY_H_
#define _NOTIFY_TRAY_H_
extern GtkWidget *notify_icon_get_box_widget();
extern void notify_icon_create();
extern void notify_icon_create_with_image_file(char *image_file_name);
extern void notify_icon_destroy();
extern int notify_icon_created_ok();
extern int notify_icon_show();
extern int notify_icon_hide();
extern void notify_icon_set_static_tooltip(const char *message);
extern void notify_icon_send_tooltip_msg(const char *title,const char *message,gint severity,gint timeout,const char *icon);
#endif /* _NOTIFY_TRAY_H_ */
From fedora-directory-commits at redhat.com Fri Sep 15 15:32:22 2006
From: fedora-directory-commits at redhat.com (Jeremy Katz (katzj))
Date: Fri, 15 Sep 2006 08:32:22 -0700
Subject: [Fedora-directory-commits] CVSROOT avail, 1.1, 1.2 dolog.pl, 1.1,
1.2 loginfo, 1.10, 1.11
Message-ID: <200609151532.k8FFWMLe032520@cvs-int.fedora.redhat.com>
Author: katzj
Update of /cvs/dirsec/CVSROOT
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv32499
Modified Files:
avail dolog.pl loginfo
Log Message:
add wtogami and myself to CVSROOT committers, try to fix commit mail
Index: avail
===================================================================
RCS file: /cvs/dirsec/CVSROOT/avail,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- avail 15 Apr 2005 15:43:19 -0000 1.1
+++ avail 15 Sep 2006 15:32:18 -0000 1.2
@@ -13,5 +13,5 @@
# Lock down the CVSROOT directory so ACLs make sense
unavail | | CVSROOT
# Access to all files to policy setters
-avail | foxworth,sopwith | CVSROOT
+avail | katzj,wtogami | CVSROOT
# trusted developers that can add modules
Index: dolog.pl
===================================================================
RCS file: /cvs/dirsec/CVSROOT/dolog.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- dolog.pl 20 Apr 2006 00:20:32 -0000 1.1
+++ dolog.pl 15 Sep 2006 15:32:18 -0000 1.2
@@ -1,4 +1,4 @@
-#! /webtools/tools/perl5/bin/perl
+#! /usr/bin/perl
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Netscape Public
Index: loginfo
===================================================================
RCS file: /cvs/dirsec/CVSROOT/loginfo,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- loginfo 20 Apr 2006 00:26:00 -0000 1.10
+++ loginfo 15 Sep 2006 15:32:18 -0000 1.11
@@ -26,6 +26,5 @@
# or
#DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog
DEFAULT $CVSROOT/CVSROOT/syncmail %{sVv} cvsdirsec at fedora.redhat.com
-^ldapserver $CVSROOT/CVSROOT/dolog.pl -r /cvs/dirsec foxworth at redhat.com
ALL /cvs/extras/CVSROOT/dolog.pl -r /cvs/dirsec localdelivery at cvs-int.fedora.redhat.com
ALL $CVSROOT/CVSROOT/syncmail --require-keyword='*docs*' %{sVv} relnotes at fedoraproject.org
From fedora-directory-commits at redhat.com Fri Sep 15 16:26:46 2006
From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins))
Date: Fri, 15 Sep 2006 09:26:46 -0700
Subject: [Fedora-directory-commits] ldapserver/ldap/servers/slapd/ntwdog
cron_conf.h, 1.4, 1.5
Message-ID: <200609151626.k8FGQkl9005366@cvs-int.fedora.redhat.com>
Author: rmeggins
Update of /cvs/dirsec/ldapserver/ldap/servers/slapd/ntwdog
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv5349/ldapserver/ldap/servers/slapd/ntwdog
Modified Files:
cron_conf.h
Log Message:
minor change to test commit email notification
Index: cron_conf.h
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/ntwdog/cron_conf.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- cron_conf.h 19 Apr 2005 22:07:40 -0000 1.4
+++ cron_conf.h 15 Sep 2006 16:26:44 -0000 1.5
@@ -111,7 +111,6 @@
/* free all cron conf data structures */
void cron_conf_free();
-#define MAGNUS_CONF "magnus.conf"
#define ADMCONFDIR "../config/"
From fedora-directory-commits at redhat.com Fri Sep 15 16:41:36 2006
From: fedora-directory-commits at redhat.com (Jeremy Katz (katzj))
Date: Fri, 15 Sep 2006 09:41:36 -0700
Subject: [Fedora-directory-commits] CVSROOT avail,1.2,1.3
Message-ID: <200609151641.k8FGfamh005929@cvs-int.fedora.redhat.com>
Author: katzj
Update of /cvs/dirsec/CVSROOT
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv5912
Modified Files:
avail
Log Message:
add remeggins to avail
Index: avail
===================================================================
RCS file: /cvs/dirsec/CVSROOT/avail,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- avail 15 Sep 2006 15:32:18 -0000 1.2
+++ avail 15 Sep 2006 16:41:34 -0000 1.3
@@ -13,5 +13,5 @@
# Lock down the CVSROOT directory so ACLs make sense
unavail | | CVSROOT
# Access to all files to policy setters
-avail | katzj,wtogami | CVSROOT
+avail | katzj,wtogami,rmeggins | CVSROOT
# trusted developers that can add modules
From fedora-directory-commits at redhat.com Fri Sep 15 18:16:18 2006
From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins))
Date: Fri, 15 Sep 2006 11:16:18 -0700
Subject: [Fedora-directory-commits] ldapserver component_versions.mk, 1.49,
1.50
Message-ID: <200609151816.k8FIGIWD014418@cvs-int.fedora.redhat.com>
Author: rmeggins
Update of /cvs/dirsec/ldapserver
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv14399
Modified Files:
component_versions.mk
Log Message:
use new 20060915 version of perldap
Index: component_versions.mk
===================================================================
RCS file: /cvs/dirsec/ldapserver/component_versions.mk,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -r1.49 -r1.50
--- component_versions.mk 28 Aug 2006 23:23:51 -0000 1.49
+++ component_versions.mk 15 Sep 2006 18:16:15 -0000 1.50
@@ -166,7 +166,7 @@
endif
ifndef PERLDAP_VERSION
- PERLDAP_VERSION=1.5/20060331
+ PERLDAP_VERSION=1.5/20060915
endif
ifndef JSS_COMP
From fedora-directory-commits at redhat.com Fri Sep 15 19:33:46 2006
From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins))
Date: Fri, 15 Sep 2006 12:33:46 -0700
Subject: [Fedora-directory-commits] ldapserver/lib/ldaputil Makefile, 1.6,
1.7
Message-ID: <200609151933.k8FJXkoE021199@cvs-int.fedora.redhat.com>
Author: rmeggins
Update of /cvs/dirsec/ldapserver/lib/ldaputil
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv21119/ldapserver/lib/ldaputil
Modified Files:
Makefile
Log Message:
Bug: 206527
Description: Enable rpmbuild of directory server
Fix Description: RELDIR is not defined in lib/ldaputil/Makefile, so just
remove the certmap.conf packaging from there and add it to ldap/cm/Makefile
The perldap packaging has changed for internal builds as well.
Tested on: Solaris
Index: Makefile
===================================================================
RCS file: /cvs/dirsec/ldapserver/lib/ldaputil/Makefile,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- Makefile 15 Sep 2006 14:59:48 -0000 1.6
+++ Makefile 15 Sep 2006 19:33:43 -0000 1.7
@@ -60,9 +60,7 @@
$(DBM_INCLUDE) $(LDAPSDK_INCLUDE) \
$(SECURITY_INCLUDE) $(NSPR_INCLUDE)
-CERTMAP_CONF = $(RELDIR)/shared/config/certmap.conf
-
-all: $(OBJDEST) $(LOCAL_DEPS) $(LIBS) $(CERTMAP_CONF)
+all: $(OBJDEST) $(LOCAL_DEPS) $(LIBS)
$(OBJDEST):
mkdir -p $(OBJDEST)
@@ -94,12 +92,5 @@
$(AR) $(OBJS)
$(RANLIB) $@
-$(CERTMAP_CONF): certmap.conf
- rm -f $@
- if [ ! -d $(dir $@) ] ; then \
- mkdir -p $(dir $@) ; \
- fi
- cp $< $(dir $@)
-
include $(INCLUDE_DEPENDS)
From fedora-directory-commits at redhat.com Fri Sep 15 19:33:44 2006
From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins))
Date: Fri, 15 Sep 2006 12:33:44 -0700
Subject: [Fedora-directory-commits] ldapserver components.mk, 1.53,
1.54 internal_comp_deps.mk, 1.46, 1.47
Message-ID: <200609151933.k8FJXia0021185@cvs-int.fedora.redhat.com>
Author: rmeggins
Update of /cvs/dirsec/ldapserver
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv21119/ldapserver
Modified Files:
components.mk internal_comp_deps.mk
Log Message:
Bug: 206527
Description: Enable rpmbuild of directory server
Fix Description: RELDIR is not defined in lib/ldaputil/Makefile, so just
remove the certmap.conf packaging from there and add it to ldap/cm/Makefile
The perldap packaging has changed for internal builds as well.
Tested on: Solaris
Index: components.mk
===================================================================
RCS file: /cvs/dirsec/ldapserver/components.mk,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- components.mk 15 Sep 2006 14:59:47 -0000 1.53
+++ components.mk 15 Sep 2006 19:33:42 -0000 1.54
@@ -623,15 +623,15 @@
ifdef PERLDAP_SOURCE_ROOT
PERLDAP_BUILT_DIR = $(PERLDAP_SOURCE_ROOT)/directory/perldap/blib
# else set in internal_buildpaths.mk and pulled in internal_comp_deps.mk
+ PERLDAP_ARCHLIB_DIR = $(PERLDAP_BUILT_DIR)/arch
+ PERLDAP_LIB_DIR = $(PERLDAP_BUILT_DIR)/lib/Mozilla
+ PERLDAP_AUTOLIB_DIR = $(PERLDAP_BUILT_DIR)/lib/auto
+ # under the serverroot/lib directory, we should have a perl directory which contains arch/, auto/, and Mozilla/
+ PACKAGE_SRC_DEST += $(PERLDAP_ARCHLIB_DIR) lib/perl
+ PACKAGE_SRC_DEST += $(PERLDAP_LIB_DIR) lib/perl
+ PACKAGE_SRC_DEST += $(PERLDAP_AUTOLIB_DIR) lib/perl
endif
-PERLDAP_ARCHLIB_DIR = $(PERLDAP_BUILT_DIR)/arch
-PERLDAP_LIB_DIR = $(PERLDAP_BUILT_DIR)/lib/Mozilla
-PERLDAP_AUTOLIB_DIR = $(PERLDAP_BUILT_DIR)/lib/auto
-# under the serverroot/lib directory, we should have a perl directory which contains arch/, auto/, and Mozilla/
-PACKAGE_SRC_DEST += $(PERLDAP_ARCHLIB_DIR) lib/perl
-PACKAGE_SRC_DEST += $(PERLDAP_LIB_DIR) lib/perl
-PACKAGE_SRC_DEST += $(PERLDAP_AUTOLIB_DIR) lib/perl
# 32-bit perldap is packaged in 64-bit DS on Solaris and HP-UX PA-RISC.
# It requires 32-bit LDAPSDK, NSPR, NSS.
Index: internal_comp_deps.mk
===================================================================
RCS file: /cvs/dirsec/ldapserver/internal_comp_deps.mk,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -r1.46 -r1.47
--- internal_comp_deps.mk 7 Sep 2006 15:29:58 -0000 1.46
+++ internal_comp_deps.mk 15 Sep 2006 19:33:42 -0000 1.47
@@ -538,8 +538,9 @@
### Perldap package #######################################
PERLDAP_COMPONENT_DIR = $(COMPONENTS_DIR_DEV)/perldap/$(PERLDAP_VERSION)/$(NSOBJDIR_NAME)
-PERLDAP_FILES=lib,arch
-PERLDAP_DEP = $(PERLDAP_BUILT_DIR)/lib
+PERLDAP_FILES=lib
+PERLDAP_DEP = $(PERLDAP_BUILT_DIR)/lib/perl
+PACKAGE_SRC_DEST += $(PERLDAP_DEP) lib
# this is the rule to pull PerLDAP
ifndef PERLDAP_PULL_METHOD
From fedora-directory-commits at redhat.com Fri Sep 15 19:33:45 2006
From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins))
Date: Fri, 15 Sep 2006 12:33:45 -0700
Subject: [Fedora-directory-commits] ldapserver/ldap/cm Makefile,1.60,1.61
Message-ID: <200609151933.k8FJXjAo021192@cvs-int.fedora.redhat.com>
Author: rmeggins
Update of /cvs/dirsec/ldapserver/ldap/cm
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv21119/ldapserver/ldap/cm
Modified Files:
Makefile
Log Message:
Bug: 206527
Description: Enable rpmbuild of directory server
Fix Description: RELDIR is not defined in lib/ldaputil/Makefile, so just
remove the certmap.conf packaging from there and add it to ldap/cm/Makefile
The perldap packaging has changed for internal builds as well.
Tested on: Solaris
Index: Makefile
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/cm/Makefile,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -r1.60 -r1.61
--- Makefile 15 Sep 2006 14:59:48 -0000 1.60
+++ Makefile 15 Sep 2006 19:33:42 -0000 1.61
@@ -310,6 +310,8 @@
$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/schema/*.ldif $(RELDIR)/bin/slapd/install/schema
$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/schema/slapd-collations.conf $(RELDIR)/bin/slapd/install/config
+ $(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/lib/ldaputil/certmap.conf $(RELDIR)/shared/config
+
# the httpd library
ifneq ($(ARCH), WINNT)
$(INSTALL) -m 755 $(OBJDIR)/$(NSHTTPD_DLL)$(DLL_PRESUF).$(DLL_SUFFIX)* $(RELDIR)/bin/slapd/lib
From fedora-directory-commits at redhat.com Fri Sep 15 21:20:38 2006
From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins))
Date: Fri, 15 Sep 2006 14:20:38 -0700
Subject: [Fedora-directory-commits]
ldapserver/ldap/schema 60pam-plugin.ldif, 1.4, 1.5
Message-ID: <200609152120.k8FLKcri029476@cvs-int.fedora.redhat.com>
Author: rmeggins
Update of /cvs/dirsec/ldapserver/ldap/schema
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv29435/ldapserver/ldap/schema
Modified Files:
60pam-plugin.ldif
Log Message:
Bug(s) fixed: 206662
Bug Description: PAM passthru: ENTRY map method not working and schema incorrect
Reviewed by: nhosoi (Thanks!)
Fix Description:
1) Rename all occurrences of pamMapMethod to pamIDMapMethod
2) The parsing code for the map method was just plain wrong - it wasn't
incrementing the pointer correctly.
3) This code: if (one == two == three == PAMPT_MAP_METHOD_NONE) - is not correct.
Platforms tested: RHEL4
Flag Day: no
Doc impact: no
Index: 60pam-plugin.ldif
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/schema/60pam-plugin.ldif,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- 60pam-plugin.ldif 19 Apr 2005 22:07:28 -0000 1.4
+++ 60pam-plugin.ldif 15 Sep 2006 21:20:35 -0000 1.5
@@ -43,9 +43,9 @@
attributeTypes: ( 2.16.840.1.113730.3.1.2067 NAME 'pamIncludeSuffix' DESC 'Suffixes to include for PAM authentication' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'Red Hat Directory Server' )
attributeTypes: ( 2.16.840.1.113730.3.1.2068 NAME 'pamExcludeSuffix' DESC 'Suffixes to exclude from PAM authentication' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'Red Hat Directory Server' )
attributeTypes: ( 2.16.840.1.113730.3.1.2069 NAME 'pamMissingSuffix' DESC 'How to handle missing include or exclude suffixes' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Red Hat Directory Server' )
-attributeTypes: ( 2.16.840.1.113730.3.1.2070 NAME 'pamMapMethod' DESC 'How to map BIND DN to PAM identity' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Red Hat Directory Server' )
+attributeTypes: ( 2.16.840.1.113730.3.1.2070 NAME 'pamIDMapMethod' DESC 'How to map BIND DN to PAM identity' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Red Hat Directory Server' )
attributeTypes: ( 2.16.840.1.113730.3.1.2071 NAME 'pamIDAttr' DESC 'Name of attribute holding PAM ID' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Red Hat Directory Server' )
attributeTypes: ( 2.16.840.1.113730.3.1.2072 NAME 'pamFallback' DESC 'Fallback to regular LDAP BIND if PAM auth fails' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-ORIGIN 'Red Hat Directory Server' )
attributeTypes: ( 2.16.840.1.113730.3.1.2073 NAME 'pamSecure' DESC 'Require secure (TLS/SSL) connection for PAM auth' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-ORIGIN 'Red Hat Directory Server' )
attributeTypes: ( 2.16.840.1.113730.3.1.2074 NAME 'pamService' DESC 'Service name to pass to pam_start' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'Red Hat Directory Server' )
-objectClasses: ( 2.16.840.1.113730.3.2.318 NAME 'pamConfig' DESC 'PAM plugin configuration' SUP top AUXILIARY MAY ( pamMissingSuffix $ pamExcludeSuffix $ pamIncludeSuffix $ pamIDAttr $ pamMapMethod $ pamFallback $ pamSecure $ pamService ) X-ORIGIN 'Red Hat Directory Server' )
+objectClasses: ( 2.16.840.1.113730.3.2.318 NAME 'pamConfig' DESC 'PAM plugin configuration' SUP top AUXILIARY MAY ( pamMissingSuffix $ pamExcludeSuffix $ pamIncludeSuffix $ pamIDAttr $ pamIDMapMethod $ pamFallback $ pamSecure $ pamService ) X-ORIGIN 'Red Hat Directory Server' )
From fedora-directory-commits at redhat.com Fri Sep 15 21:20:38 2006
From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins))
Date: Fri, 15 Sep 2006 14:20:38 -0700
Subject: [Fedora-directory-commits]
ldapserver/ldap/servers/plugins/pam_passthru README, 1.4,
1.5 config.ldif, 1.4, 1.5 pam_ptconfig.c, 1.6, 1.7
Message-ID: <200609152120.k8FLKcOu029484@cvs-int.fedora.redhat.com>
Author: rmeggins
Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/pam_passthru
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv29435/ldapserver/ldap/servers/plugins/pam_passthru
Modified Files:
README config.ldif pam_ptconfig.c
Log Message:
Bug(s) fixed: 206662
Bug Description: PAM passthru: ENTRY map method not working and schema incorrect
Reviewed by: nhosoi (Thanks!)
Fix Description:
1) Rename all occurrences of pamMapMethod to pamIDMapMethod
2) The parsing code for the map method was just plain wrong - it wasn't
incrementing the pointer correctly.
3) This code: if (one == two == three == PAMPT_MAP_METHOD_NONE) - is not correct.
Platforms tested: RHEL4
Flag Day: no
Doc impact: no
Index: README
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/pam_passthru/README,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- README 19 Apr 2005 22:07:30 -0000 1.4
+++ README 15 Sep 2006 21:20:36 -0000 1.5
@@ -86,7 +86,7 @@
* pamIDAttr (string) - The value of this attribute, present in the
user's entry, holds the PAM identity of the user - it maps the LDAP
identity to the PAM identity
-* pamMapMethod (string)
+* pamIDMapMethod (string)
o RDN (default) - uses the value from the leftmost RDN in the BIND DN
o ENTRY - gets the value of the PAM identity attribute from the BIND DN entry
o DN - uses the full DN string
@@ -137,13 +137,13 @@
We may have to worry about different PAM policy in different subtrees
e.g. maybe for dc=coke,dc=com you want to use the ENTRY map method,
but for dc=pepsi,dc=com you want to use the RDN method. We could
-probably do this by having the pamMapMethod attr be multivalued, and
+probably do this by having the pamIDMapMethod attr be multivalued, and
have it's value like this:
-pamMapMethod: RDN dc=coke,dc=com
-pamMapMethod: RDN dc=sprite,dc=com
-pamMapMethod: ENTRY dc=pepsi,dc=com
-pamMapMethod: DN (the default for all other suffixes)
+pamIDMapMethod: RDN dc=coke,dc=com
+pamIDMapMethod: RDN dc=sprite,dc=com
+pamIDMapMethod: ENTRY dc=pepsi,dc=com
+pamIDMapMethod: DN (the default for all other suffixes)
The suffix that uses that map method would follow the map method used.
@@ -201,7 +201,7 @@
pamMissingSuffix: ALLOW
pamExcludeSuffix: o=NetscapeRoot
pamExcludeSuffix: cn=config
-pamMapMethod: RDN
+pamIDMapMethod: RDN
pamFallback: FALSE
pamSecure: TRUE
pamService: ldapserver
Index: config.ldif
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/pam_passthru/config.ldif,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- config.ldif 19 Apr 2005 22:07:30 -0000 1.4
+++ config.ldif 15 Sep 2006 21:20:36 -0000 1.5
@@ -50,7 +50,7 @@
pamMissingSuffix: ALLOW
pamExcludeSuffix: o=NetscapeRoot
pamExcludeSuffix: cn=config
-pamMapMethod: RDN
+pamIDMapMethod: RDN
pamFallback: FALSE
pamSecure: TRUE
pamService: ldapserver
Index: pam_ptconfig.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/pam_passthru/pam_ptconfig.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- pam_ptconfig.c 25 May 2006 14:37:14 -0000 1.6
+++ pam_ptconfig.c 15 Sep 2006 21:20:36 -0000 1.7
@@ -188,11 +188,11 @@
{
char *end;
int len;
- int ret;
+ int ret = PAMPT_MAP_METHOD_NONE;
*err = 0;
if (!map_method || !*map_method) {
- return PAMPT_MAP_METHOD_NONE;
+ return ret;
}
end = strchr(*map_method, ' ');
@@ -211,7 +211,7 @@
*err = 1;
}
- if (!err) {
+ if (!*err) {
if (end && *end) {
*map_method = end + 1;
} else {
@@ -225,36 +225,37 @@
static int
parse_map_method(char *map_method, int *one, int *two, int *three, char *returntext)
{
- int err = 0;
+ int err = LDAP_SUCCESS;
int extra;
+ char **ptr = &map_method;
*one = *two = *three = PAMPT_MAP_METHOD_NONE;
- *one = meth_to_int(&map_method, &err);
+ *one = meth_to_int(ptr, &err);
if (err) {
PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE,
"The map method in the string [%s] is invalid: must be "
"one of %s", map_method, get_map_method_values());
return LDAP_UNWILLING_TO_PERFORM;
}
- *two = meth_to_int(&map_method, &err);
+ *two = meth_to_int(ptr, &err);
if (err) {
PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE,
"The map method in the string [%s] is invalid: must be "
"one of %s", map_method, get_map_method_values());
return LDAP_UNWILLING_TO_PERFORM;
}
- *three = meth_to_int(&map_method, &err);
+ *three = meth_to_int(ptr, &err);
if (err) {
PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE,
"The map method in the string [%s] is invalid: must be "
"one of %s", map_method, get_map_method_values());
return LDAP_UNWILLING_TO_PERFORM;
}
- if (((extra = meth_to_int(&map_method, &err)) != PAMPT_MAP_METHOD_NONE) ||
+ if (((extra = meth_to_int(ptr, &err)) != PAMPT_MAP_METHOD_NONE) ||
err) {
PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE,
"Invalid extra text [%s] after last map method",
- map_method);
+ ((ptr && *ptr) ? *ptr : "(null)"));
return LDAP_UNWILLING_TO_PERFORM;
}
@@ -341,7 +342,10 @@
map_method = slapi_entry_attr_get_charptr(e, PAMPT_MAP_METHOD_ATTR);
if (map_method) {
int one, two, three;
- *returncode = parse_map_method(map_method, &one, &two, &three, returntext);
+ if (LDAP_SUCCESS !=
+ (*returncode = parse_map_method(map_method, &one, &two, &three, returntext))) {
+ goto done; /* returntext set already */
+ }
if (!pam_ident_attr &&
((one == PAMPT_MAP_METHOD_ENTRY) || (two == PAMPT_MAP_METHOD_ENTRY) ||
(three == PAMPT_MAP_METHOD_ENTRY))) {
@@ -351,7 +355,8 @@
*returncode = LDAP_UNWILLING_TO_PERFORM;
goto done;
}
- if (one == two == three == PAMPT_MAP_METHOD_NONE) {
+ if ((one == PAMPT_MAP_METHOD_NONE) && (two == PAMPT_MAP_METHOD_NONE) &&
+ (three == PAMPT_MAP_METHOD_NONE)) {
PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE, "Error: no method(s)"
" specified for %s, should be one or more of %s",
PAMPT_MAP_METHOD_ATTR, get_map_method_values());
From fedora-directory-commits at redhat.com Fri Sep 15 22:45:14 2006
From: fedora-directory-commits at redhat.com (Noriko Hosoi (nhosoi))
Date: Fri, 15 Sep 2006 15:45:14 -0700
Subject: [Fedora-directory-commits] ldapserver/ldap/servers/slapd
slapi-private.h, 1.10, 1.11 connection.c, 1.10, 1.11 daemon.c,
1.8, 1.9
Message-ID: <200609152245.k8FMjEH3001109@cvs-int.fedora.redhat.com>
Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/servers/slapd
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv1087
Modified Files:
slapi-private.h connection.c daemon.c
Log Message:
[206724] Replacing PR_SetNetAddr with PRLDAP_SET_PORT for IPv6 support
slapi-private.h: introduced PRLDAP_SET_PORT to set port to the port field in
PRNetAddr. A copy of the same macro in LDAP C SDK (v6). Note: once NSPR
provides an equivalent API, we may want to replace this macro with the one.
(the NSPR compatibility issue remains, though.)
connection.c, daemon.c: replaced PR_SetNetAddr with PRLDAP_SET_PORT.
Index: slapi-private.h
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/slapi-private.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- slapi-private.h 11 Apr 2006 02:14:44 -0000 1.10
+++ slapi-private.h 15 Sep 2006 22:45:11 -0000 1.11
@@ -1236,6 +1236,22 @@
#define SLAPI_UPGRADEDB_SKIPINIT 0x2 /* call upgradedb as part of other op */
#endif
+/*
+ * Macro to set port to the 'port' field of a NSPR PRNetAddr union.
+ ** INPUTS:
+ ** PRNetAddr *myaddr A network address.
+ ** PRUint16 myport port to set to the 'port' field of 'addr'.
+ ** RETURN: none
+ *
+ * Note: Copy from ldappr-int.h in
+ * ldapcsdk:mozilla/directory/c-sdk/ldap/libraries/libprldap
+ * Introduced to avoid calling PR_SetNetAddr w/ PR_IpAddrNull just to set port.
+ * Once NSPR starts providing better function/macro to do the same job,
+ * this macro should be replaced with it. (newer than NSPR v4.6.2)
+ */
+#define PRLDAP_SET_PORT(myaddr,myport) \
+ ((myaddr)->raw.family == PR_AF_INET6 ? ((myaddr)->ipv6.port = PR_htons(myport)) : ((myaddr)->inet.port = PR_htons(myport)))
+
#ifdef __cplusplus
}
#endif
Index: connection.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/connection.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- connection.c 31 Aug 2006 23:26:25 -0000 1.10
+++ connection.c 15 Sep 2006 22:45:11 -0000 1.11
@@ -43,7 +43,6 @@
#include
#include
#endif
-#define TCPLEN_T int
#include
#include "slap.h"
#include "prcvar.h"
@@ -64,7 +63,6 @@
static int is_ber_too_big(const Connection *conn, ber_len_t ber_len);
static void log_ber_too_big_error(const Connection *conn,
ber_len_t ber_len, ber_len_t maxbersize);
-static int add_to_select_set(Connection *conn);
/*
* We maintain a global work queue of Slapi_PBlock's that have not yet
@@ -206,11 +204,10 @@
connection_reset(Connection* conn, int ns, PRNetAddr * from, int fromLen, int is_SSL)
{
char * pTmp = is_SSL ? "SSL " : "";
- TCPLEN_T addrlen, destaddrlen;
- struct sockaddr_in addr, destaddr;
- char *str_ip, *str_destip, buf_ip[ 256 ], buf_destip[ 256 ];
+ char *str_ip = NULL, *str_destip;
+ char buf_ip[ 256 ], buf_destip[ 256 ];
char *str_unknown = "unknown";
- int in_referral_mode = config_check_referral_mode();
+ int in_referral_mode = config_check_referral_mode();
LDAPDebug( LDAP_DEBUG_CONNS, "new %sconnection on %d\n", pTmp, conn->c_sd, 0 );
@@ -220,120 +217,127 @@
PR_Unlock( num_conns_mutex );
if (! in_referral_mode) {
- PR_AtomicIncrement(g_get_global_snmp_vars()->ops_tbl.dsConnectionSeq);
- PR_AtomicIncrement(g_get_global_snmp_vars()->ops_tbl.dsConnections);
+ PR_AtomicIncrement(g_get_global_snmp_vars()->ops_tbl.dsConnectionSeq);
+ PR_AtomicIncrement(g_get_global_snmp_vars()->ops_tbl.dsConnections);
}
- /* get peer address (IP address of this client) */
- addrlen = sizeof( addr );
- memset( &addr, 0, addrlen );
-
- if ( ((from->ipv6.ip.pr_s6_addr32[0] != 0) ||
+ /*
+ * get peer address (IP address of this client)
+ */
+ slapi_ch_free( (void**)&conn->cin_addr ); /* just to be conservative */
+ if ( ((from->ipv6.ip.pr_s6_addr32[0] != 0) || /* from contains non zeros */
(from->ipv6.ip.pr_s6_addr32[1] != 0) ||
(from->ipv6.ip.pr_s6_addr32[2] != 0) ||
(from->ipv6.ip.pr_s6_addr32[3] != 0)) ||
((conn->c_prfd != NULL) && (PR_GetPeerName( conn->c_prfd, from ) == 0)) ) {
- conn->cin_addr = (PRNetAddr *) slapi_ch_malloc( sizeof( PRNetAddr ) );
- memcpy( conn->cin_addr, from, sizeof( PRNetAddr ) );
+ conn->cin_addr = (PRNetAddr *) slapi_ch_malloc( sizeof( PRNetAddr ) );
+ memcpy( conn->cin_addr, from, sizeof( PRNetAddr ) );
- if ( PR_IsNetAddrType( conn->cin_addr, PR_IpAddrV4Mapped ) ) {
- PRNetAddr v4addr;
- memset( &v4addr, 0, sizeof( v4addr ) );
- v4addr.inet.family = PR_AF_INET;
- v4addr.inet.ip = conn->cin_addr->ipv6.ip.pr_s6_addr32[3];
- PR_NetAddrToString( &v4addr, buf_ip, sizeof( buf_ip ) );
- } else {
- PR_NetAddrToString( conn->cin_addr, buf_ip, sizeof( buf_ip ) );
- }
- buf_ip[ sizeof( buf_ip ) - 1 ] = '\0';
- str_ip = buf_ip;
-
- } else if ( (conn->c_prfd == NULL) &&
- (getpeername( conn->c_sd, (struct sockaddr*)&addr, &addrlen ) == 0) ) {
- conn->cin_addr = (PRNetAddr *)slapi_ch_malloc( sizeof( PRNetAddr ) );
+ if ( PR_IsNetAddrType( conn->cin_addr, PR_IpAddrV4Mapped ) ) {
+ PRNetAddr v4addr;
+ memset( &v4addr, 0, sizeof( v4addr ) );
+ v4addr.inet.family = PR_AF_INET;
+ v4addr.inet.ip = conn->cin_addr->ipv6.ip.pr_s6_addr32[3];
+ PR_NetAddrToString( &v4addr, buf_ip, sizeof( buf_ip ) );
+ } else {
+ PR_NetAddrToString( conn->cin_addr, buf_ip, sizeof( buf_ip ) );
+ }
+ buf_ip[ sizeof( buf_ip ) - 1 ] = '\0';
+ str_ip = buf_ip;
- if ( PR_SetNetAddr(PR_IpAddrNull, PR_AF_INET6, addr.sin_port, conn->cin_addr)
- != PR_SUCCESS ) {
- int oserr = PR_GetError();
- LDAPDebug( LDAP_DEBUG_ANY, "PR_SetNetAddr() failed, "
- SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n",
- oserr, slapd_pr_strerror(oserr), 0 );
- } else {
- PR_ConvertIPv4AddrToIPv6(addr.sin_addr.s_addr, &(conn->cin_addr->ipv6.ip));
- }
-
- /* copy string equivalent of address into a buffer to use for
- * logging since each call to inet_ntoa() returns a pointer to a
- * single thread-specific buffer (which prevents us from calling
- * inet_ntoa() twice in one call to slapi_log_access()).
- */
- str_ip = inet_ntoa( addr.sin_addr );
- strncpy( buf_ip, str_ip, sizeof( buf_ip ) - 1 );
- buf_ip[ sizeof( buf_ip ) - 1 ] = '\0';
- str_ip = buf_ip;
-
} else {
- str_ip = str_unknown;
- }
-
+ /* try syscall since "from" was not given and PR_GetPeerName failed */
+ /* a corner case */
+ struct sockaddr_in addr; /* assuming IPv4 */
+ socklen_t addrlen;
+
+ addrlen = sizeof( addr );
+ memset( &addr, 0, addrlen );
+
+ if ( (conn->c_prfd == NULL) &&
+ (getpeername( conn->c_sd, (struct sockaddr *)&addr, &addrlen )
+ == 0) ) {
+ conn->cin_addr = (PRNetAddr *)slapi_ch_malloc( sizeof( PRNetAddr ));
+ memset( conn->cin_addr, 0, sizeof( PRNetAddr ) );
+ PR_NetAddrFamily( conn->cin_addr ) = AF_INET6;
+ /* note: IPv4-mapped IPv6 addr does not work on Windows */
+ PR_ConvertIPv4AddrToIPv6(addr.sin_addr.s_addr, &(conn->cin_addr->ipv6.ip));
+ PRLDAP_SET_PORT(conn->cin_addr, addr.sin_port);
+
+ /* copy string equivalent of address into a buffer to use for
+ * logging since each call to inet_ntoa() returns a pointer to a
+ * single thread-specific buffer (which prevents us from calling
+ * inet_ntoa() twice in one call to slapi_log_access()).
+ */
+ str_ip = inet_ntoa( addr.sin_addr );
+ strncpy( buf_ip, str_ip, sizeof( buf_ip ) - 1 );
+ buf_ip[ sizeof( buf_ip ) - 1 ] = '\0';
+ str_ip = buf_ip;
+ } else {
+ str_ip = str_unknown;
+ }
+ }
/*
* get destination address (server IP address this client connected to)
*/
- destaddrlen = sizeof( destaddr );
- memset( &destaddr, 0, destaddrlen );
-
-
+ slapi_ch_free( (void**)&conn->cin_addr ); /* just to be conservative */
if ( conn->c_prfd != NULL ) {
- conn->cin_destaddr = (PRNetAddr *) slapi_ch_malloc( sizeof( PRNetAddr ) );
- if (PR_GetSockName( conn->c_prfd, conn->cin_destaddr ) == 0) {
- if ( PR_IsNetAddrType( conn->cin_destaddr, PR_IpAddrV4Mapped ) ) {
- PRNetAddr v4destaddr;
- memset( &v4destaddr, 0, sizeof( v4destaddr ) );
- v4destaddr.inet.family = PR_AF_INET;
- v4destaddr.inet.ip = conn->cin_destaddr->ipv6.ip.pr_s6_addr32[3];
- PR_NetAddrToString( &v4destaddr, buf_destip, sizeof( buf_destip ) );
- } else {
- PR_NetAddrToString( conn->cin_destaddr, buf_destip, sizeof( buf_destip ) );
- }
- buf_destip[ sizeof( buf_destip ) - 1 ] = '\0';
- str_destip = buf_destip;
- } else {
- str_destip = str_unknown;
- }
- } else if ( (conn->c_prfd == NULL) &&
- (getsockname( conn->c_sd, (struct sockaddr*)&destaddr, &destaddrlen ) == 0) ) {
- conn->cin_destaddr = (PRNetAddr *)slapi_ch_malloc( sizeof( PRNetAddr ) );
-
- if ( PR_SetNetAddr(PR_IpAddrNull, PR_AF_INET6, destaddr.sin_port, conn->cin_destaddr)
- != PR_SUCCESS ) {
- int oserr = PR_GetError();
- LDAPDebug( LDAP_DEBUG_ANY, "PR_SetNetAddr() failed, "
- SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n",
- oserr, slapd_pr_strerror(oserr), 0 );
- } else {
- PR_ConvertIPv4AddrToIPv6(destaddr.sin_addr.s_addr, &(conn->cin_destaddr->ipv6.ip));
- }
-
- /* copy string equivalent of address into a buffer to use for
- * logging since each call to inet_ntoa() returns a pointer to a
- * single thread-specific buffer (which prevents us from calling
- * inet_ntoa() twice in one call to slapi_log_access()).
- */
- str_destip = inet_ntoa( destaddr.sin_addr );
- strncpy( buf_destip, str_destip, sizeof( buf_destip ) - 1 );
- buf_destip[ sizeof( buf_destip ) - 1 ] = '\0';
- str_destip = buf_destip;
-
+ conn->cin_destaddr = (PRNetAddr *) slapi_ch_malloc( sizeof( PRNetAddr ) );
+ memset( conn->cin_destaddr, 0, sizeof( PRNetAddr ));
+ if (PR_GetSockName( conn->c_prfd, conn->cin_destaddr ) == 0) {
+ if ( PR_IsNetAddrType( conn->cin_destaddr, PR_IpAddrV4Mapped ) ) {
+ PRNetAddr v4destaddr;
+ memset( &v4destaddr, 0, sizeof( v4destaddr ) );
+ v4destaddr.inet.family = PR_AF_INET;
+ v4destaddr.inet.ip = conn->cin_destaddr->ipv6.ip.pr_s6_addr32[3];
+ PR_NetAddrToString( &v4destaddr, buf_destip, sizeof( buf_destip ) );
+ } else {
+ PR_NetAddrToString( conn->cin_destaddr, buf_destip, sizeof( buf_destip ) );
+ }
+ buf_destip[ sizeof( buf_destip ) - 1 ] = '\0';
+ str_destip = buf_destip;
+ } else {
+ str_destip = str_unknown;
+ }
} else {
- str_destip = str_unknown;
- }
+ /* try syscall since c_prfd == NULL */
+ /* a corner case */
+ struct sockaddr_in destaddr; /* assuming IPv4 */
+ socklen_t destaddrlen;
+
+ destaddrlen = sizeof( destaddr );
+ memset( &destaddr, 0, destaddrlen );
+ if ( (getsockname( conn->c_sd, (struct sockaddr *)&destaddr,
+ &destaddrlen ) == 0) ) {
+ conn->cin_destaddr =
+ (PRNetAddr *)slapi_ch_malloc( sizeof( PRNetAddr ));
+ memset( conn->cin_destaddr, 0, sizeof( PRNetAddr ));
+ PR_NetAddrFamily( conn->cin_destaddr ) = AF_INET6;
+ PRLDAP_SET_PORT( conn->cin_destaddr, destaddr.sin_port );
+ /* note: IPv4-mapped IPv6 addr does not work on Windows */
+ PR_ConvertIPv4AddrToIPv6(destaddr.sin_addr.s_addr,
+ &(conn->cin_destaddr->ipv6.ip));
+
+ /* copy string equivalent of address into a buffer to use for
+ * logging since each call to inet_ntoa() returns a pointer to a
+ * single thread-specific buffer (which prevents us from calling
+ * inet_ntoa() twice in one call to slapi_log_access()).
+ */
+ str_destip = inet_ntoa( destaddr.sin_addr );
+ strncpy( buf_destip, str_destip, sizeof( buf_destip ) - 1 );
+ buf_destip[ sizeof( buf_destip ) - 1 ] = '\0';
+ str_destip = buf_destip;
+ } else {
+ str_destip = str_unknown;
+ }
+ }
- if ( !in_referral_mode ) {
- /* create a sasl connection */
- ids_sasl_server_new(conn);
- }
+ if ( !in_referral_mode ) {
+ /* create a sasl connection */
+ ids_sasl_server_new(conn);
+ }
/* log useful stuff to our access log */
slapi_log_access( LDAP_DEBUG_STATS,
@@ -343,7 +347,7 @@
/* initialize the remaining connection fields */
conn->c_ldapversion = LDAP_VERSION3;
conn->c_starttime = current_time();
- conn->c_idlesince = conn->c_starttime;
+ conn->c_idlesince = conn->c_starttime;
conn->c_flags = is_SSL ? CONN_FLAG_SSL : 0;
conn->c_authtype = slapi_ch_strdup(SLAPD_AUTH_NONE);
}
@@ -624,6 +628,7 @@
static int handle_read_data(Connection *conn,Operation **op,
int * connection_referenced);
int queue_pushed_back_data(Connection *conn);
+static int add_to_select_set(Connection *conn);
static void inc_op_count(Connection* conn)
{
Index: daemon.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/daemon.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- daemon.c 11 Apr 2006 02:14:44 -0000 1.8
+++ daemon.c 15 Sep 2006 22:45:11 -0000 1.9
@@ -277,7 +277,7 @@
PRIntervalTime pr_timeout = PR_MillisecondsToInterval(slapd_wakeup_timer);
-#if !defined( XP_WIN32 )
+#if !defined( XP_WIN32 ) /* UNIX */
(*pr_clonefd) = PR_Accept(pr_acceptfd, pr_netaddr, pr_timeout);
if( !(*pr_clonefd) ) {
PRErrorCode prerr = PR_GetError();
@@ -289,7 +289,7 @@
ns = configure_pr_socket( pr_clonefd, secure );
-#else
+#else /* Windows */
if( secure ) {
(*pr_clonefd) = PR_Accept(pr_acceptfd, pr_netaddr, pr_timeout);
if( !(*pr_clonefd) ) {
@@ -315,10 +315,10 @@
ns = configure_pr_socket( pr_clonefd, secure );
- } else {
- struct sockaddr *addr;
+ } else { /* !secure */
+ struct sockaddr *addr; /* NOT IPv6 enabled */
- addr = (struct sockaddr *) slapi_ch_malloc( sizeof(struct sockaddr) );
+ addr = (struct sockaddr *) slapi_ch_malloc( sizeof(struct sockaddr) );
ns = accept (s, addr, (TCPLEN_T *)&addrlen);
if (ns == SLAPD_INVALID_SOCKET) {
@@ -329,25 +329,18 @@
s, oserr, slapd_system_strerror(oserr));
}
- else if (syn_scan (ns))
- {
- /* this is a work around for accept problem with SYN scan on NT.
- See bug 391414 for more details */
- LDAPDebug(LDAP_DEBUG_ANY, "syn-scan request is received - ignored\n", 0, 0, 0);
- closesocket (ns);
- ns = SLAPD_INVALID_SOCKET;
- }
-
- if ( PR_SetNetAddr(PR_IpAddrNull, PR_AF_INET6, ((struct sockaddr_in *)addr)->sin_port, pr_netaddr)
- != PR_SUCCESS ) {
- int oserr = PR_GetError();
- LDAPDebug( LDAP_DEBUG_ANY, "PR_SetNetAddr() failed, "
- SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n",
- oserr, slapd_pr_strerror(oserr), 0 );
- } else {
- PR_ConvertIPv4AddrToIPv6(((struct sockaddr_in *)addr)->sin_addr.s_addr, &(pr_netaddr->ipv6.ip));
+ else if (syn_scan (ns))
+ {
+ /* this is a work around for accept problem with SYN scan on NT.
+ See bug 391414 for more details */
+ LDAPDebug(LDAP_DEBUG_ANY, "syn-scan request is received - ignored\n", 0, 0, 0);
+ closesocket (ns);
+ ns = SLAPD_INVALID_SOCKET;
}
+ PRLDAP_SET_PORT( pr_netaddr, ((struct sockaddr_in *)addr)->sin_port );
+ PR_ConvertIPv4AddrToIPv6(((struct sockaddr_in *)addr)->sin_addr.s_addr, &(pr_netaddr->ipv6.ip));
+
(*pr_clonefd) = NULL;
slapi_ch_free( (void **)&addr );
@@ -2278,7 +2271,7 @@
static PRFileDesc *
-createprlistensocket(unsigned short port, const PRNetAddr *listenaddr,
+createprlistensocket(PRUint16 port, const PRNetAddr *listenaddr,
int secure)
{
PRFileDesc *sock;
@@ -2313,15 +2306,7 @@
/* set up listener address, including port */
memcpy(&sa_server, listenaddr, sizeof(sa_server));
- if ( PR_SetNetAddr(PR_IpAddrNull, PR_AF_INET6, port, &sa_server)
- != PR_SUCCESS ) {
- prerr = PR_GetError();
- slapi_log_error(SLAPI_LOG_FATAL, logname,
- "PR_SetNetAddr() failed: %s error %d (%s)\n",
- SLAPI_COMPONENT_NAME_NSPR,
- prerr, slapd_pr_strerror(prerr));
- goto failed;
- }
+ PRLDAP_SET_PORT( &sa_server, port );
if ( PR_Bind(sock, &sa_server) == PR_FAILURE) {
prerr = PR_GetError();
@@ -2354,8 +2339,7 @@
{
char *logname = "slapd_listenhost2addr";
PRErrorCode prerr = 0;
- PRHostEnt hent;
- char hbuf[ PR_NETDB_BUF_SIZE ];
+ int rval = 0;
PR_ASSERT( addr != NULL );
@@ -2366,37 +2350,33 @@
slapi_log_error( SLAPI_LOG_FATAL, logname,
"PR_SetNetAddr(PR_IpAddrAny) failed - %s error %d (%s)\n",
SLAPI_COMPONENT_NAME_NSPR, prerr, slapd_pr_strerror(prerr));
- goto failed;
+ rval = -1;
}
} else if (PR_SUCCESS == PR_StringToNetAddr(listenhost, addr)) {
- if (PR_AF_INET == PR_NetAddrFamily(addr)) {
- PRUint32 ipv4ip = addr->inet.ip;
- memset(addr, 0, sizeof(PRNetAddr));
- PR_ConvertIPv4AddrToIPv6(ipv4ip, &addr->ipv6.ip);
- addr->ipv6.family = PR_AF_INET6;
- }
- } else if (PR_SUCCESS == PR_GetIPNodeByName(listenhost,
- PR_AF_INET6, PR_AI_DEFAULT | PR_AI_ALL,
- hbuf, sizeof(hbuf), &hent )) {
- /* just use the first IP address returned */
- if (PR_EnumerateHostEnt(0, &hent, 0, addr) < 0) {
+ /* PR_StringNetAddr newer than NSPR v4.6.2 supports both IPv4&v6 */;
+ } else {
+ PRAddrInfo *infop = PR_GetAddrInfoByName( listenhost,
+ PR_AF_UNSPEC, (PR_AI_ADDRCONFIG|PR_AI_NOCANONNAME) );
+ if ( NULL != infop ) {
+ memset( addr, 0, sizeof( PRNetAddr ));
+ if ( NULL == PR_EnumerateAddrInfo( NULL, infop, 0, addr )) {
+ slapi_log_error( SLAPI_LOG_FATAL, logname,
+ "PR_EnumerateAddrInfo for %s failed - %s error %d (%s)\n",
+ listenhost, SLAPI_COMPONENT_NAME_NSPR, prerr,
+ slapd_pr_strerror(prerr));
+ rval = -1;
+ }
+ PR_FreeAddrInfo( infop );
+ } else {
slapi_log_error( SLAPI_LOG_FATAL, logname,
- "PR_EnumerateHostEnt() failed - %s error %d (%s)\n",
- SLAPI_COMPONENT_NAME_NSPR, prerr, slapd_pr_strerror(prerr));
- goto failed;
+ "PR_GetAddrInfoByName(%s) failed - %s error %d (%s)\n",
+ listenhost, SLAPI_COMPONENT_NAME_NSPR, prerr,
+ slapd_pr_strerror(prerr));
+ rval = -1;
}
- } else { /* failure */
- slapi_log_error( SLAPI_LOG_FATAL, logname,
- "PR_GetIPNodeByName(%s) failed - %s error %d (%s)\n",
- listenhost, SLAPI_COMPONENT_NAME_NSPR, prerr,
- slapd_pr_strerror(prerr));
- goto failed;
}
- return( 0 );
-
-failed:
- return( -1 );
+ return rval;
}
From fedora-directory-commits at redhat.com Sat Sep 16 15:10:56 2006
From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins))
Date: Sat, 16 Sep 2006 08:10:56 -0700
Subject: [Fedora-directory-commits] ldapserver internal_comp_deps.mk, 1.47,
1.48
Message-ID: <200609161510.k8GFAuKd004861@cvs-int.fedora.redhat.com>
Author: rmeggins
Update of /cvs/dirsec/ldapserver
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv4843
Modified Files:
internal_comp_deps.mk
Log Message:
fix build breakage - use PERLDAP_BUILT_DIR as the location to download perl since the full DEP has two directory levels in it
Index: internal_comp_deps.mk
===================================================================
RCS file: /cvs/dirsec/ldapserver/internal_comp_deps.mk,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -r1.47 -r1.48
--- internal_comp_deps.mk 15 Sep 2006 19:33:42 -0000 1.47
+++ internal_comp_deps.mk 16 Sep 2006 15:10:53 -0000 1.48
@@ -551,7 +551,7 @@
ifdef INTERNAL_BUILD
$(RM) -rf $@
$(FTP_PULL) -method $(PERLDAP_PULL_METHOD) \
- -objdir $(dir $@) \
+ -objdir $(PERLDAP_BUILT_DIR) \
-componentdir $(PERLDAP_COMPONENT_DIR) \
-files $(PERLDAP_FILES)
@if [ ! -d $@ ] ; \
From fedora-directory-commits at redhat.com Fri Sep 22 20:16:30 2006
From: fedora-directory-commits at redhat.com (Noriko Hosoi (nhosoi))
Date: Fri, 22 Sep 2006 13:16:30 -0700
Subject: [Fedora-directory-commits] ldapserver component_versions.mk, 1.50,
1.51
Message-ID: <200609222016.k8MKGUOj007508@cvs-int.fedora.redhat.com>
Author: nhosoi
Update of /cvs/dirsec/ldapserver
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv7479
Modified Files:
component_versions.mk
Log Message:
Upgraded NSPR_RELDATE to v4.6.3-dstest.
This upgrade is made from 1) v4.6.2 -> v4.6.3 and 2) applying a new ipv6.patch
from [mozilla 34843].
Index: component_versions.mk
===================================================================
RCS file: /cvs/dirsec/ldapserver/component_versions.mk,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -r1.50 -r1.51
--- component_versions.mk 15 Sep 2006 18:16:15 -0000 1.50
+++ component_versions.mk 22 Sep 2006 20:16:27 -0000 1.51
@@ -52,7 +52,7 @@
# naming scheme.
# NSPR
ifndef NSPR_RELDATE
- NSPR_RELDATE = v4.6.2-dstest
+ NSPR_RELDATE = v4.6.3-dstest
endif
# SECURITY (NSS) LIBRARY
From fedora-directory-commits at redhat.com Sun Sep 24 00:30:54 2006
From: fedora-directory-commits at redhat.com (Noriko Hosoi (nhosoi))
Date: Sat, 23 Sep 2006 17:30:54 -0700
Subject: [Fedora-directory-commits] ldapserver/ldap/servers/slapd
connection.c, 1.11, 1.12
Message-ID: <200609240030.k8O0Uscr005603@cvs-int.fedora.redhat.com>
Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/servers/slapd
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv5432
Modified Files:
connection.c
Log Message:
[206724] Processed: Replacing PR_SetNetAddr with PRLDAP_SET_PORT for IPv6 support
comment#5: Fixed a stupid copy and paste bug...
Index: connection.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/connection.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- connection.c 15 Sep 2006 22:45:11 -0000 1.11
+++ connection.c 24 Sep 2006 00:30:50 -0000 1.12
@@ -281,7 +281,7 @@
/*
* get destination address (server IP address this client connected to)
*/
- slapi_ch_free( (void**)&conn->cin_addr ); /* just to be conservative */
+ slapi_ch_free( (void**)&conn->cin_destaddr ); /* just to be conservative */
if ( conn->c_prfd != NULL ) {
conn->cin_destaddr = (PRNetAddr *) slapi_ch_malloc( sizeof( PRNetAddr ) );
memset( conn->cin_destaddr, 0, sizeof( PRNetAddr ));
From fedora-directory-commits at redhat.com Tue Sep 26 22:08:19 2006
From: fedora-directory-commits at redhat.com (Nathan Kinder (nkinder))
Date: Tue, 26 Sep 2006 15:08:19 -0700
Subject: [Fedora-directory-commits] ldapserver/ldap/servers/slapd sasl_io.c,
1.7, 1.8
Message-ID: <200609262208.k8QM8Jau009761@cvs-int.fedora.redhat.com>
Author: nkinder
Update of /cvs/dirsec/ldapserver/ldap/servers/slapd
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv9744
Modified Files:
sasl_io.c
Log Message:
208058 - Copy decrypted SASL data starting from buffer offset instead of always copying from the beginning of the buffer.
Index: sasl_io.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/sasl_io.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- sasl_io.c 17 Aug 2006 15:33:03 -0000 1.7
+++ sasl_io.c 26 Sep 2006 22:08:17 -0000 1.8
@@ -314,7 +314,8 @@
if (bytes_to_return > count) {
bytes_to_return = count;
}
- memcpy(buffer, sp->decrypted_buffer, bytes_to_return);
+ /* Copy data from the decrypted buffer starting at the offset */
+ memcpy(buffer, sp->decrypted_buffer + sp->decrypted_buffer_offset, bytes_to_return);
if (bytes_in_buffer == bytes_to_return) {
sp->decrypted_buffer_offset = 0;
sp->decrypted_buffer_count = 0;
From fedora-directory-commits at redhat.com Wed Sep 27 17:09:26 2006
From: fedora-directory-commits at redhat.com (Jack Magne (jmagne))
Date: Wed, 27 Sep 2006 10:09:26 -0700
Subject: [Fedora-directory-commits] esc/src/app/daemon - New directory
Message-ID: <200609271709.k8RH9Qam025722@cvs-int.fedora.redhat.com>
Author: jmagne
Update of /cvs/dirsec/esc/src/app/daemon
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv25702/daemon
Log Message:
Directory /cvs/dirsec/esc/src/app/daemon added to the repository
From fedora-directory-commits at redhat.com Wed Sep 27 17:10:04 2006
From: fedora-directory-commits at redhat.com (Jack Magne (jmagne))
Date: Wed, 27 Sep 2006 10:10:04 -0700
Subject: [Fedora-directory-commits] esc/src/app/daemon escd.cpp, NONE,
1.1 escd.h, NONE, 1.1 Makefile, NONE, 1.1 manifest.mn, NONE, 1.1
Message-ID: <200609271710.k8RHA4Bj025881@cvs-int.fedora.redhat.com>
Author: jmagne
Update of /cvs/dirsec/esc/src/app/daemon
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv25849
Added Files:
escd.cpp escd.h Makefile manifest.mn
Log Message:
Initial revision.
--- NEW FILE escd.cpp ---
/** 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
#include
#include
#include
#include
#include
#include
#include "pk11func.h"
#define SHELL "/bin/sh"
#define CORRECT_NUM_ARGS 3
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: ! 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;
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 arg1Tokens;
vector arg2Tokens;
string argument1 = "";
string argument2 = "";
string delim = "=";
vector::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::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_flags = 0;
sigaction(SIGUSR1,&sigESCD,NULL);
sigaction(SIGTERM,&sigESCD,NULL);
// Install the XWindows IO Error Handler
XSetIOErrorHandler(ESC_D::xIOErrorHandler);
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 = S_OK;
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& 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;
}
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)
{
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 System, this will result in problems recognizing Smart Cards! \n"));
}
//Now become an XWindows program so we can die on user logout
Display *display;
XEvent event;
display = XOpenDisplay(NULL);
if(!display)
{
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;
}
--- NEW FILE escd.h ---
/** 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
#include
#include
#include "prlock.h"
#include
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 int xIOErrorHandler(Display *display);
static ESC_D *single;
PRLock *mDataLock;
HRESULT launchCommand(string &command);
private:
void TokenizeArgument(const string& str,
vector& 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
--- NEW FILE Makefile ---
#! 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). #
#######################################################################
--- NEW FILE manifest.mn ---
# 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 -lX11
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
From fedora-directory-commits at redhat.com Wed Sep 27 17:17:31 2006
From: fedora-directory-commits at redhat.com (Jack Magne (jmagne))
Date: Wed, 27 Sep 2006 10:17:31 -0700
Subject: [Fedora-directory-commits] esc/rpm - New directory
Message-ID: <200609271717.k8RHHV3V026239@cvs-int.fedora.redhat.com>
Author: jmagne
Update of /cvs/dirsec/esc/rpm
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv26224/rpm
Log Message:
Directory /cvs/dirsec/esc/rpm added to the repository
From fedora-directory-commits at redhat.com Wed Sep 27 17:19:21 2006
From: fedora-directory-commits at redhat.com (Jack Magne (jmagne))
Date: Wed, 27 Sep 2006 10:19:21 -0700
Subject: [Fedora-directory-commits]
esc/rpm esc, NONE, 1.1 esc.desktop, NONE, 1.1 esc.spec, NONE, 1.1
Message-ID: <200609271719.k8RHJLDt026311@cvs-int.fedora.redhat.com>
Author: jmagne
Update of /cvs/dirsec/esc/rpm
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv26292
Added Files:
esc esc.desktop esc.spec
Log Message:
Initial revision
--- NEW FILE esc ---
#!/bin/sh
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
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
exit 0
--- NEW FILE esc.desktop ---
[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=Smart Card Manager
Comment=Enterprise Security Client Smart Card Manager
Categories=System;Application;SystemSetup;X-Red-Hat-Base;
Exec=esc
Icon=esc.png
--- NEW FILE esc.spec ---
Name: esc
Version: 1.0.0
Release: 16%{?dist}
Summary: Enterprise Security Client Smart Card Client
License: GPL
URL: http://directory.fedora.redhat.com/wiki/CoolKey
Group: Applications/Internet
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Patch1: firefox-1.5.0.1-dumpstack.patch
Patch2: xulrunner-1.8.0.1-coreconf.patch
Patch3: firefox-1.5-with-system-nss.patch
Patch4: firefox-1.1-nss-system-nspr.patch
Patch5: esc-1.0.0-xul-sys-nss-nspr.patch
Patch6: esc-1.0.0-ui-enhance.patch
Patch7: esc-1.0.0-notify-icon-fixes.patch
Patch8: esc-1.0.0-strings-fix.patch
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
Patch16: esc-1.0.0-escd2.patch
Patch17: esc-1.0.0-build-fix.patch
Patch18: esc-1.0.0-diag-fix.patch
BuildRequires: doxygen fontconfig-devel freetype-devel >= 2.1
BuildRequires: glib2-devel libIDL-devel atk-devel gtk2-devel libjpeg-devel
BuildRequires: pango-devel libpng-devel pkgconfig zlib-devel
BuildRequires: nspr-devel nss-devel
BuildRequires: autoconf213 libX11-devel libXt-devel
BuildRequires: pcsc-lite-devel coolkey-devel
BuildRequires: desktop-file-utils zip binutils libnotify-devel
BuildRequires: dbus-devel
Requires: pcsc-lite ifd-egate coolkey nss nspr
Requires: zip dbus >= 0.90 libnotify >= 0.4.2
# 390 does not have coolkey or smartCards
# Xulrunner won't compile on ppc64 right now.
ExcludeArch: s390 s390x ppc64
# We can't allow the internal xulrunner to leak out
AutoReqProv: 0
#%define __prelink_undo_cmd %{nil}
%define escname %{name}-%{version}
%define escdir %{_libdir}/%{escname}
%define escbindir %{_bindir}
%define esc_chromepath chrome/content/esc
%define appdir applications
%define icondir %{_datadir}/icons/hicolor/48x48/apps
%define esc_vendor esc
%define autostartdir %{_sysconfdir}/xdg/autostart
%define pixmapdir %{_datadir}/pixmaps
%define docdir %{_defaultdocdir}/%{escname}
%define escappdir src/app/xpcom
Source0: %{escname}.tar.bz2
Source1: esc
Source2: esc.desktop
Source3: xulrunner-1.8.0.1-source.tar.bz2
%description
Enterprise Security Client allows the user to enroll and manage their
cryptographic smartcards.
%prep
%setup -q -c -n %{escname}
#patch esc to use system nss and nspr.
%patch5 -p1 -b .fix5
%patch6 -p1 -b .fix6
%patch7 -p1 -b .fix7
%patch8 -p1 -b .fix8
%patch11 -p1 -b .fix11
%patch12 -p1 -b .fix12
%patch13 -p1 -b .fix13
%patch14 -p1 -b .fix14
%patch15 -p1 -b .fix15
%patch16 -p1 -b .fix16
%patch17 -p1 -b .fix17
%patch18 -p1 -b .fix18
#Unpack xulrunner where esc expects it to be.
%setup -T -D -a 3 -n %{escname}/esc/dist/src
#Perform the patching of xulrunner
cd mozilla
%patch1 -p1 -b .fix1
%patch2 -p1 -b .fix2
%patch3 -p1 -b .fix3
%patch4 -p1 -b .fix4
%build
%ifarch x86_64 ppc64 ia64
USE_64=1
export USE_64
%endif
# last setup call moved the current directory
cd ../..
make BUILD_OPT=1 HAVE_LIB_NOTIFY=1
%install
cd ../../src/app/xpcom
mkdir -p $RPM_BUILD_ROOT/%{escbindir}
mkdir -p $RPM_BUILD_ROOT/%{icondir}
mkdir -p $RPM_BUILD_ROOT/%{_datadir}/%{appdir}
mkdir -p $RPM_BUILD_ROOT/%{autostartdir}
mkdir -p $RPM_BUILD_ROOT/%{pixmapdir}
mkdir -p $RPM_BUILD_ROOT/%{docdir}
sed -e 's;\$LIBDIR;'%{_libdir}';g' %{SOURCE1} > $RPM_BUILD_ROOT/%{escbindir}/%{name}
chmod 755 $RPM_BUILD_ROOT/%{escbindir}/esc
mkdir -p $RPM_BUILD_ROOT/%{escdir}
%ifarch x86_64 ppc64 ia64
USE_64=1
export USE_64
%endif
make BUILD_OPT=1 install DESTDIR=$RPM_BUILD_ROOT/%{escdir}
rm -rf $RPM_BUILD_ROOT/%{escdir}/usr
cd ../../../dist/*OPT*/esc_build/esc
cp %{esc_chromepath}/esc.png $RPM_BUILD_ROOT/%{icondir}
ln -s $RPMBUILD_ROOT%{icondir}/esc.png $RPM_BUILD_ROOT/%{pixmapdir}/esc.png
cp %{SOURCE2} $RPM_BUILD_ROOT/%{_datadir}/%{appdir}
cp %{SOURCE2} $RPM_BUILD_ROOT/%{autostartdir}
cd %{_builddir}
cp %{escname}/esc/LICENSE $RPM_BUILD_ROOT/%{docdir}
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%{escdir}/esc
%{escdir}/escd
%{escbindir}/esc
%{escdir}/application.ini
%{escdir}/chrome/chrome.manifest
%{escdir}/chrome/content
%{escdir}/chrome/locale
%{escdir}/chrome/icons/default
%{escdir}/components
%{escdir}/defaults/preferences/esc-prefs.js
%{escdir}/xulrunner
%{icondir}/esc.png
%{pixmapdir}/esc.png
%{autostartdir}/esc.desktop
%{_datadir}/%{appdir}/esc.desktop
%doc %{docdir}/LICENSE
%post
touch --no-create %{_datadir}/icons/hicolor || :
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
fi
%postun
touch --no-create %{_datadir}/icons/hicolor || :
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
fi
%changelog
* Fri Sep 22 2006 Jack Magne = 1.0.0-15
- Fix to the build version
* Fri Sep 22 2006 Jack Magne = 1.0.0-14
- Fix to compile error in daemon
* Fri Sep 22 2006 Jack Magne - 1.0.0-13
- Fix to include the new esc daemon.
* Sat Sep 16 2006 Jack Magne - 1.0.0-12
- Fix for Password Reset and minor UI revision.
* Fri Sep 15 2006 Jack Magne - 1.0.0-11
- Further UI enhancement bug fixes
* Thu Sep 7 2006 Jack Magne - 1.0.0-10
- Further strings revisions.
* Wed Aug 30 2006 Jack Magne - 1.0.0-9
- Revision of the strings used in ESC.
* Sat Aug 27 2006 Jack Magne - 1.0.0-8
- Fixes to get libnotify working properly on FC6 systems.
* Tue Aug 22 2006 Jack Magne - 1.0.0-7
- Fix for bug #203211, use of system NSS and NSPR for
- Xulrunner ,addressing the problem running on 64 bit.
- Overwriting 5 and 6 due to important bug #203211.
* Fri Aug 18 2006 Jack Magne - 1.0.0-6
- Correct problem with Patch #6
* Tue Aug 17 2006 Jack Magne - 1.0.0-5
- Build ESC's xulrunner component using system nss and nspr
- Build process creates run script based on {_libdir} variable,
accounting for differences on 64 bit machines.
- UI enhancements
* Tue Aug 1 2006 Matthias Clasen - 1.0.0-4
- Don't auto-generate requires either
* Mon Jul 31 2006 Matthias Clasen - 1.0.0-3
- Don't provide mozilla libraries
* Fri Jul 28 2006 Ray Strode - 1.0.0-2
- remove bogus gtk+ requires (and some others that will
be automatic)
* Tue Jun 13 2006 Jack Magne - 1.0.0-1
- Initial revision for fedora
From fedora-directory-commits at redhat.com Wed Sep 27 17:22:01 2006
From: fedora-directory-commits at redhat.com (Jack Magne (jmagne))
Date: Wed, 27 Sep 2006 10:22:01 -0700
Subject: [Fedora-directory-commits] esc/src/app/xpcom/tray rhITray.idl, 1.2,
1.3 rhLinuxTray.cpp, 1.2, 1.3 rhMacTray.cpp, 1.2,
1.3 rhTray.cpp, 1.2, 1.3
Message-ID: <200609271722.k8RHM16n026517@cvs-int.fedora.redhat.com>
Author: jmagne
Update of /cvs/dirsec/esc/src/app/xpcom/tray
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv26495
Modified Files:
rhITray.idl rhLinuxTray.cpp rhMacTray.cpp rhTray.cpp
Log Message:
Latest updates.
Index: rhITray.idl
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xpcom/tray/rhITray.idl,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- rhITray.idl 13 Sep 2006 17:50:07 -0000 1.2
+++ rhITray.idl 27 Sep 2006 17:21:58 -0000 1.3
@@ -24,6 +24,8 @@
void setwindnotifycallback(in rhITrayWindNotify jsNotify);
void unsetwindnotifycallback(in rhITrayWindNotify jsNotify);
+ void setmenuitemtext(in unsigned long aIndex, in string aText);
+
};
Index: rhLinuxTray.cpp
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xpcom/tray/rhLinuxTray.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- rhLinuxTray.cpp 13 Sep 2006 17:50:07 -0000 1.2
+++ rhLinuxTray.cpp 27 Sep 2006 17:21:58 -0000 1.3
@@ -269,7 +269,6 @@
mInitialized = 1;
- notify_icon_hide();
return S_OK;
}
@@ -421,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,
@@ -440,7 +442,8 @@
event->button,
event->time);
- }
+ }
+ }
}
@@ -586,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)
@@ -719,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"));
}
Index: rhMacTray.cpp
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xpcom/tray/rhMacTray.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- rhMacTray.cpp 13 Sep 2006 17:50:07 -0000 1.2
+++ rhMacTray.cpp 27 Sep 2006 17:21:58 -0000 1.3
@@ -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)
Index: rhTray.cpp
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xpcom/tray/rhTray.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- rhTray.cpp 13 Sep 2006 17:50:07 -0000 1.2
+++ rhTray.cpp 27 Sep 2006 17:21:58 -0000 1.3
@@ -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)
From fedora-directory-commits at redhat.com Wed Sep 27 17:22:22 2006
From: fedora-directory-commits at redhat.com (Jack Magne (jmagne))
Date: Wed, 27 Sep 2006 10:22:22 -0700
Subject: [Fedora-directory-commits] esc/src/app/xpcom Makefile.moz, 1.2,
1.3 rhCoolKey.cpp, 1.2, 1.3 rhICoolKey.idl, 1.2, 1.3
Message-ID: <200609271722.k8RHMMIk026545@cvs-int.fedora.redhat.com>
Author: jmagne
Update of /cvs/dirsec/esc/src/app/xpcom
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv26524
Modified Files:
Makefile.moz rhCoolKey.cpp rhICoolKey.idl
Log Message:
Latest updates.
Index: Makefile.moz
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xpcom/Makefile.moz,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Makefile.moz 13 Sep 2006 17:50:07 -0000 1.2
+++ Makefile.moz 27 Sep 2006 17:22:20 -0000 1.3
@@ -103,6 +103,7 @@
install::
ifdef DESTDIR
$(NSINSTALL) $(DEPLOY_OBJDIR)/esc/* $(DESTDIR)
+ $(NSINSTALL) $(CORE_DIST)/bin/escd $(DESTDIR)
endif
all:: export libs
Index: rhCoolKey.cpp
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xpcom/rhCoolKey.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- rhCoolKey.cpp 13 Sep 2006 17:50:07 -0000 1.2
+++ rhCoolKey.cpp 27 Sep 2006 17:22:20 -0000 1.3
@@ -39,6 +39,7 @@
#include "nsXPCOMGlue.h"
#include "prlink.h"
#include "nscore.h"
+#include "content/nsCopySupport.h"
#include
#include
@@ -1066,6 +1067,43 @@
return NS_OK;
}
+
+/* boolean GetCoolKeyIsReallyCoolKey (in unsigned long aKeyType, in string aKeyID); */
+
+
+NS_IMETHODIMP rhCoolKey::GetCoolKeyIsReallyCoolKey(PRUint32 aKeyType, const char *aKeyID, PRBool *_retval)
+{
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::GetCoolKeyIsReallyCoolKey thread: %p \n",PR_GetCurrentThread()));
+
+ if (ASCCoolKeyIsAvailable(aKeyType, (char *) aKeyID)) {
+ if (aKeyID) {
+ AutoCoolKey key(aKeyType, aKeyID);
+ PRBool isCool = CoolKeyIsReallyCoolKey(&key);
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::GetCoolKeyIsReallyCoolKey isCool: %d \n",(int) isCool));
+ *_retval= isCool;
+ return NS_OK;
+ }
+ }
+ *_retval = PR_FALSE;
+ return NS_OK;
+}
+
+/* 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)
+{
+
+ PR_LOG(coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::GetCoolKeyAppletVer thread: %p \n",PR_GetCurrentThread()));
+
+ AutoCoolKey key(aKeyType, aKeyID);
+
+ int ver = CoolKeyGetAppletVer(&key, aIsMajor);
+
+ *_retval = ver;
+
+ return S_OK;
+
+}
+
/* boolean rhCoolKeyIsEnrolled (in unsigned long aKeyType, in string aKeyID); */
NS_IMETHODIMP rhCoolKey::GetCoolKeyIsEnrolled(PRUint32 aKeyType, const char *aKeyID, PRBool *_retval)
@@ -1094,6 +1132,9 @@
string certInfo = "";
*aCertInfo = NULL;
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::GetCoolKeyCertInfo thread: %p \n",PR_GetCurrentThread()));
+
+
AutoCoolKey key(aKeyType, aKeyID);
@@ -1317,7 +1358,7 @@
{
PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::GetCoolKeyVersion \n"));
- char *version = "1.0.0-10";
+ char *version = "1.0.0-16";
char *versionVal = (char *) nsMemory::Clone(version,sizeof(char) * strlen(version) + 1);
Index: rhICoolKey.idl
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xpcom/rhICoolKey.idl,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- rhICoolKey.idl 13 Sep 2006 17:50:07 -0000 1.2
+++ rhICoolKey.idl 27 Sep 2006 17:22:20 -0000 1.3
@@ -19,6 +19,7 @@
#include "rhIKeyNotify.idl"
#include "nsIObserver.idl"
+interface nsIDOMHTMLDocument;
[scriptable,uuid(ea54eee4-9548-4b63-b94d-c519ffc91d09)]
interface rhICoolKey: nsISupports
@@ -73,9 +74,15 @@
void SetCoolKeyDataValue(in unsigned long aKeyType,in string aKeyID,in string name,in string value);
boolean SetCoolKeyConfigValue(in string aName, in string aValue);
+
+ boolean GetCoolKeyIsReallyCoolKey(in unsigned long aKeyType, in string aKeyID);
+
+ long GetCoolKeyGetAppletVer(in unsigned long aKeyType, in string aKeyID , in boolean aIsMajor);
+
string GetCoolKeyConfigValue(in string aName);
string GetCoolKeyVersion();
+
};
From fedora-directory-commits at redhat.com Wed Sep 27 17:24:35 2006
From: fedora-directory-commits at redhat.com (Jack Magne (jmagne))
Date: Wed, 27 Sep 2006 10:24:35 -0700
Subject: [Fedora-directory-commits] esc/src/app/xul/esc/chrome/content/esc
advancedinfo.xul, NONE, 1.1
Message-ID: <200609271724.k8RHOZcT026701@cvs-int.fedora.redhat.com>
Author: jmagne
Update of /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv26679
Added Files:
advancedinfo.xul
Log Message:
Latest updates.
--- NEW FILE advancedinfo.xul ---
&diagnosticsMessage;
From fedora-directory-commits at redhat.com Wed Sep 27 17:25:26 2006
From: fedora-directory-commits at redhat.com (Jack Magne (jmagne))
Date: Wed, 27 Sep 2006 10:25:26 -0700
Subject: [Fedora-directory-commits] esc/src/app/xul/esc/chrome/content/esc
password.js, NONE, 1.1
Message-ID: <200609271725.k8RHPQKj026816@cvs-int.fedora.redhat.com>
Author: jmagne
Update of /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv26773
Added Files:
password.js
Log Message:
Latest updates.
--- NEW FILE password.js ---
var parentWindow = window.opener;
function doOperation()
{
//alert("doOperation opener " + parentWindow + " nam " + window.name);
var pin = GetLocalPINValue();
if(!pin)
return;
parentWindow.SetPINValue(pin);
var theOperation = window.name;
if(theOperation == "resetpin")
parentWindow.DoResetSelectedCoolKeyPIN();
if(theOperation == "enroll")
parentWindow.DoEnrollCoolKey();
window.close();
}
function GetLocalPINValue()
{
var pintf_obj = document.getElementById("pintf");
var reenterpintf_obj = document.getElementById("reenterpintf");
var pinVal = null;
var rpinVal = null;
if(pintf_obj)
pinVal = pintf_obj.value;
if(reenterpintf_obj)
rpinVal = reenterpintf_obj.value;
if (! pinVal && pintf_obj)
{
MyAlert("You must provide a valid Token PIN!");
return null;
}
if ( pinVal != rpinVal && reenterpintf_obj)
{
MyAlert("The PIN values you entered don't match!");
return null;
}
return pinVal;
}
function PasswordLoad()
{
window.sizeToContent();
}
From fedora-directory-commits at redhat.com Wed Sep 27 17:30:39 2006
From: fedora-directory-commits at redhat.com (Jack Magne (jmagne))
Date: Wed, 27 Sep 2006 10:30:39 -0700
Subject: [Fedora-directory-commits] esc/src/app/xul/esc/chrome/content/esc
password.js, 1.1, 1.2
Message-ID: <200609271730.k8RHUdJZ027075@cvs-int.fedora.redhat.com>
Author: jmagne
Update of /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv27057
Modified Files:
password.js
Log Message:
License.
Index: password.js
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/password.js,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- password.js 27 Sep 2006 17:25:23 -0000 1.1
+++ password.js 27 Sep 2006 17:30:36 -0000 1.2
@@ -1,3 +1,19 @@
+/** 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 **/
var parentWindow = window.opener;
From fedora-directory-commits at redhat.com Wed Sep 27 17:31:20 2006
From: fedora-directory-commits at redhat.com (Jack Magne (jmagne))
Date: Wed, 27 Sep 2006 10:31:20 -0700
Subject: [Fedora-directory-commits] esc/src/app/xul/esc/chrome/content/esc
password.xul, NONE, 1.1
Message-ID: <200609271731.k8RHVKYU027125@cvs-int.fedora.redhat.com>
Author: jmagne
Update of /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv27109
Added Files:
password.xul
Log Message:
License.
--- NEW FILE password.xul ---
From fedora-directory-commits at redhat.com Wed Sep 27 17:31:54 2006
From: fedora-directory-commits at redhat.com (Jack Magne (jmagne))
Date: Wed, 27 Sep 2006 10:31:54 -0700
Subject: [Fedora-directory-commits] esc/src/app/xul/esc/chrome/content/esc
AdvancedInfo.js, 1.1, 1.2 ESC.js, 1.2, 1.3 GenericAuth.js, 1.2,
1.3 GenericAuth.xul, 1.1.1.1, 1.2 TRAY.js, 1.2, 1.3 config.xul,
1.2, 1.3 esc.css, 1.2, 1.3 esc.xul, 1.2, 1.3 settings.xul, 1.2, 1.3
Message-ID: <200609271731.k8RHVsi6027163@cvs-int.fedora.redhat.com>
Author: jmagne
Update of /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv27136
Modified Files:
AdvancedInfo.js ESC.js GenericAuth.js GenericAuth.xul TRAY.js
config.xul esc.css esc.xul settings.xul
Log Message:
Latest updates.
Index: AdvancedInfo.js
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/AdvancedInfo.js,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AdvancedInfo.js 13 Sep 2006 18:01:01 -0000 1.1
+++ AdvancedInfo.js 27 Sep 2006 17:31:51 -0000 1.2
@@ -15,21 +15,21 @@
* All rights reserved.
* END COPYRIGHT BLOCK **/
+
+var gDiagnosticsDataText="";
+
function ShowAdvancedInfo()
{
- var dump = window.arguments[0];
+ var textDump = window.arguments[0];
+ gDiagnosticsData=dump;
+ gDiagnosticsDataText=textDump;
- var frame = window.document.getElementById("advanced-info");
+ var textbox = window.document.getElementById("advanced-info");
- var doco = frame.contentDocument;
-
- if(doco)
+ if(textbox)
{
- doco.open();
- doco.write(dump);
- doco.close();
-
+ textbox.setAttribute("value",textDump);
}
}
Index: ESC.js
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/ESC.js,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ESC.js 13 Sep 2006 17:56:49 -0000 1.2
+++ ESC.js 27 Sep 2006 17:31:51 -0000 1.3
@@ -32,8 +32,6 @@
var gHiddenPageDone = 0;
var gExternalUI = 0;
-var gDiagnosticsCopyString=null;
-
loadStringBundle();
//ESC constants
@@ -46,6 +44,11 @@
const ISSUER_TAG = "IssuerName";
const SERVICE_INFO_TAG = "ServiceInfo";
+const UNINITIALIZED = 1;
+const UNINITIALIZED_NOAPPLET = 2;
+const ESC_ENROLL_WIDTH = 600;
+const ESC_ENROLL_HEIGHT = 570;
+
//Window names
const ENROLL_WINDOW = "esc.xul";
@@ -215,22 +218,33 @@
}
+// Main function that oversees obtaining Phone Home Info from the Server
+
function DoPhoneHome(keyType,keyID)
{
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
{
- launchCONFIG(keyType,keyID);
+ 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;
}
@@ -240,10 +254,10 @@
if(home)
{
- homeRes = phoneHome(home,keyID,callback);
+ homeRes = phoneHome(home,keyID,callback);
}
- if(!homeRes)
+ if(!home)
{
launchCONFIG(keyType,keyID);
}
@@ -797,69 +811,136 @@
var arr = GetAvailableCoolKeys();
var coolkeyVersion = GetCoolKeyVersion();
- var dump = "";
- dump += "";
+ var textDump="";
+
+ textDump += getBundleString("diagnosticsReport") + "\n\n";
+
+ textDump += "***" + getBundleString("diagnosticsSystemInfo") + "***" + "\n\n";
+ var agent = getBundleString("diagnosticsSoftVersioInfo") + " " + navigator.userAgent.toLowerCase() + "\n";
- //dump += " " + getBundleString("diagnosticsMessage") + "
";
+ textDump += " " + getBundleString("coolkeyComponentVersion");
+ textDump += " " + coolkeyVersion + "\n";
- dump += "" + getBundleString("coolkeyComponentVersion") + " " ;
- dump += " " + coolkeyVersion ;
- dump += "" + getBundleString("coolkeyDetectedNumberKeys") + " ";
- dump += " " + arr.length + "
" ;
+ textDump += " " + agent + "\n";
+
+ textDump += "***" + getBundleString("diagnosticsDetails") + "***" + "\n\n";
+
+ textDump += " " + getBundleString("coolkeyDetectedNumberKeys") + " ";
+
+ textDump += arr.length + "\n\n" ;
- dump += "";
for(i = 0 ; i < arr.length ; i++)
{
keyID = arr[i][1];
keyType = arr[i][0];
+ var appletVerMaj = DoGetCoolKeyGetAppletVer(keyType, keyID , true);
+ var appletVerMin = DoGetCoolKeyGetAppletVer(keyType, keyID, false);
+
var issuer = GetCachedIssuer(keyID);
if(!issuer)
issuer = getBundleString("unknownIssuer");
+ textDump += "***" + getBundleString("smartCardU") + " " + i + ":" + "***" + "\n\n";
+
+ textDump += " " + getBundleString("appletVersion") + " " + appletVerMaj + "." + appletVerMin + "\n";
+
+
var status = GetStatusForKeyID(keyType, keyID);
- dump += "" + getBundleString("keyID") + " " + " " + keyID + " ";
- dump += "" + getBundleString("status") + " " + " " + status + " ";
+ textDump += " " + getBundleString("keyID") + " " + " " + keyID + "\n";
+ textDump += " " + getBundleString("status") + " " + " " + status + "\n";
+ textDump += " " + getBundleString("issuer") + " " + " " + issuer + "\n";
- dump += "" + getBundleString("issuer") + " " + " " + issuer + " ";
var tpsURI = GetCachedTPSURL(keyID);
var tpsUI = GetCachedTPSUI(keyID);
+ var phoneHomeURI = GetCachedPhoneHomeURL(keyID);
+
+ if(!tpsURI)
+ tpsURI="";
+
+ if(!tpsUI)
+ tpsUI = "";
+
+ if(!phoneHomeURI)
+ phoneHomeURI = "";
+
+ textDump += " " + getBundleString("tpsPhoneHomeURL") + " " + " " + phoneHomeURI + "\n";
+ textDump += " " + getBundleString("tpsURI") + " " + " " + tpsURI + "\n";
+ textDump += " " +getBundleString("tpsUI") + " " + " " + tpsUI + "\n";
- dump += "" + getBundleString("tpsURI") + " " + " " + tpsURI + " ";
- dump += "" + getBundleString("tpsUI") + " " + " " + tpsUI + " ";
+ textDump += "\n";
+
+ var nicknames = GetCoolKeyCertNicknames(keyType,keyID);
+ if(nicknames && nicknames.length)
+ {
+ textDump += " " + getBundleString("certsOnToken") + " \n\n";
+ }
+
+ if(nicknames)
+ {
+ var cert_info = null;
+ for (i = 0; i < nicknames.length ; i ++)
+ {
+ textDump += " " + getBundleString("certificateNickname") + " " + nicknames[i] + " \n\n";
+
+ cert_info = GetCoolKeyCertInfo(keyType,keyID,nicknames[i]);
+
+ var cert_split = cert_info.split("\n");
+
+
+ if(cert_split.length)
+ {
+
+ textDump += " " + getBundleString("certIssuedTo") + " " + cert_split[0] + "\n";
+
+ textDump += " " + getBundleString("certIssuedBy") + " " + cert_split[1] + "\n";
+
+ textDump += " " + getBundleString("certValidityFrom") + " " + cert_split[2] + "\n";
+
+
+ textDump += " " + getBundleString("certValidityTo") + " " + cert_split[3] + "\n";
+
+ textDump += " " + getBundleString("certSerialNumber") + " " + cert_split[4] + "\n";
+
+
+ textDump += "\n";
+ }
+
+ }
+ }
}
- dump += "
";
+ if(i <= 0)
+ {
+ textDump += "\n";
+ }
var lines = null;
var lines = ReadESCLog();
- dump += "" + getBundleString("escLogEntries") + " ";
- dump += "";
+ textDump += "***" + getBundleString("escLogEntries") + "***" + "\n";
+
if(lines)
{
for(i = 0 ; i < lines.length ; i++)
{
- dump += lines[i] + " ";
+ textDump += lines[i] + "\n";
}
}
else
{
- dump += getBundleString("noLogFileOrData");
- }
- dump += "
";
-
- dump += "";
+ textDump += getBundleString("noLogFileOrData");
+ }
- var wnd = window.openDialog("chrome://esc/content/advancedinfo.xul","Info","chrome,centerscreen,width=600,height=500,modal=yes",dump);
+ var wnd = window.openDialog("chrome://esc/content/advancedinfo.xul","Info","chrome,centerscreen,width=600,height=500,modal=yes",textDump);
}
@@ -1338,15 +1419,29 @@
var detected_key_message = document.getElementById("detected-key-message");
var enroll_key_message = document.getElementById("enroll-key-message");
+
+ if(!enroll_key_message)
+ return;
+
var unenrolled_key_heading = document.getElementById("unenrolled-key-heading");
+ if(!unenrolled_key_heading)
+ return;
+
+
+ var enroll_proceed_message = document.getElementById("enroll-proceed-message");
+
+ if(!enroll_proceed_message)
+ return;
if(alreadyEnrolled)
{
unenrolled_key_heading.setAttribute("value",getBundleString("enrolledDetected"));
+ ChangeDescription(enroll_proceed_message,getBundleString("enrollAnyway"));
+ }
+ else
+ {
+ ChangeDescription(enroll_proceed_message,getBundleString("readyToProceed"));
}
-
- if(!unenrolled_key_heading)
- return;
var no_key_heading = document.getElementById("no-key-heading");
@@ -1407,7 +1502,9 @@
ShowItem(enroll_area);
HideItem(yes_key_area);
ShowItem(enroll_key_message);
- enrollBtn.setAttribute("oncommand","DoEnrollCoolKey()");
+
+ enrollBtn.setAttribute("onclick","DoEnrollCoolKey();");
+
ShowItem(enrollBtn);
}
else
@@ -1420,7 +1517,7 @@
HideItem(yes_key_area);
HideItem(enroll_key_message);
HideItem(enrollBtn);
- UpdateESCSize(600,550);
+ UpdateESCSize(ESC_ENROLL_WIDTH,ESC_ENROLL_HEIGHT);
}
}
@@ -1432,11 +1529,16 @@
if(alreadyEnrolled)
{
- detected_key_message.setAttribute("value",getBundleString("enrolledDetectedMessage"));
+ ChangeDescription(detected_key_message,getBundleString("enrolledDetectedMessage"));
+ }
+ else
+ {
+ ChangeDescription(detected_key_message,getBundleString("unenrolledDetectedMessage"));
+
}
ShowItem(detected_key_message);
- enrollBtn.setAttribute("oncommand","DoShowFullEnrollmentUI()");
+ enrollBtn.setAttribute("onclick","DoShowFullEnrollmentUI();");
ShowItem(enrollBtn);
}
@@ -1502,19 +1604,19 @@
return;
}
- if(pwstrength < 20)
+ if(pwstrength < 40)
{
qualityImage.setAttribute("src", "2-vweak.png");
return;
}
- if(pwstrength >= 20 && pwstrength < 40)
+ if(pwstrength >= 40 && pwstrength < 50)
{
qualityImage.setAttribute("src","3-weak.png");
return;
}
- if(pwstrength >=40 && pwstrength < 60)
+ if(pwstrength >=50 && pwstrength < 60)
{
qualityImage.setAttribute("src","4-fair.png");
return;
@@ -1580,16 +1682,16 @@
switch (status) {
case 7: // PINResetInProgress
- result = "Resetting Key Password..";
+ result = getBundleString("operationPINReset");
break;
case 5: // EnrollmentInProgress
- result = "Enrolling Key..";
+ result = getBundleString("operationEnrollment");
break;
case 9: // FormatInProgress
- result = "Formatting Key..";
+ result = getBundleString("operationFormat");
break;
}
@@ -1782,11 +1884,16 @@
InsertCoolKeyIntoAdminBindingList(arr[i][0], arr[i][1]);
if (!gCurrentSelectedRow)
+ {
SelectRowByKeyID(arr[i][0], arr[i][1]);
+ UpdateAdminKeyDetailsArea(arr[i][0],arr[i][1]);
+ }
}
if(i > 0)
+ {
UpdateESCSize();
+ }
}
function UpdateBindingTableAvailability()
@@ -1812,7 +1919,7 @@
gEnrollmentPage = 1;
UpdateCoolKeyAvailabilityForEnrollment();
UpdateButtonStates();
- showOrHideEscOnLaunch();
+ //showOrHideEscOnLaunch();
window.setTimeout("showOrHideTabsUI()",2);
}
@@ -1820,7 +1927,7 @@
{
UpdateBindingTableAvailability();
UpdateButtonStates();
- showOrHideEscOnLaunch();
+ //showOrHideEscOnLaunch();
}
function InitializeAdminBindingList()
@@ -1830,8 +1937,8 @@
UpdateAdminBindingListAvailability();
UpdateButtonStates();
- showOrHideEscOnLaunch();
- showOrHideTabsUI();
+ //showOrHideEscOnLaunch();
+ //showOrHideTabsUI();
}
//Window related functions
@@ -1844,7 +1951,8 @@
// We do want notify events though
var doPreserveNotify = true;
-
+
+ SetMenuItemsText();
TrayRemoveWindow(doPreserveNotify);
}
@@ -1954,12 +2062,27 @@
return result;
}
-function SelectESCPage(keyUninitialized)
+function SelectESCPage(keyType,keyID,phoneHomeFailed)
{
if(!gHiddenPage)
return;
+ var keyUninitialized = 0;
+ var keyStatus = GetCoolKeyStatus(keyType,keyID);
+
+ switch (keyStatus) {
+ case 1: //no applet
+ keyUninitialized = UNINITIALIZED_NOAPPLET;
+ break;
+ case 2: // uninitialized
+ keyUninitialized = UNINITIALIZED;
+ break;
+ case 4: // Enrolled
+ keyUninitialized = 0;
+ break;
+ }
+
//alert("SelectESCPage initialized " + keyUninitialized + " gEnrollmentPage " + gEnrollmentPage + " gFactoryMode " + gFactoryMode + " gHiddenPage " + gHiddenPage);
//Get the primary page windows if present
@@ -1967,7 +2090,7 @@
var enrollWnd = IsPageWindowPresent(ENROLL_WINDOW);
var adminWnd = IsPageWindowPresent(ADMIN_WINDOW);
- if(keyUninitialized)
+ if(keyUninitialized == UNINITIALIZED && !phoneHomeFailed) //formatted uninitialized card
{
if(!TrayLoadedOK()) // We have no tray icon, launch both
@@ -1975,10 +2098,11 @@
if(!adminWnd)
{
- launchSETTINGS();
+ // launchSETTINGS();
}
}
+
if(enrollWnd) //Enrollment window is already up
{
enrollWnd.focus();
@@ -1992,9 +2116,8 @@
else
{
//Launch admin page if factory mode is enabled
- // or we are without the tray icon.
- if(gFactoryMode)
+ if(gFactoryMode || phoneHomeFailed || keyUninitialized == UNINITIALIZED_NOAPPLET) //no applet
{
if(adminWnd) // Handle case where admin page is already up
@@ -2069,6 +2192,8 @@
function UpdateButtonStates()
{
+return;
+
var enroll_btn = document.getElementById("enrollbtn");
var reset_btn = document.getElementById("resetpinbtn");
@@ -2268,6 +2393,8 @@
if(!gAdminPage)
return;
+ var isCool = DoGetCoolKeyIsReallyCoolKey(keyType, keyID);
+
var noKey = 0;
if(!keyType || !keyID)
@@ -2365,8 +2492,16 @@
DisableItem(enrollbtn);
- EnableItem(resetpinbtn);
- EnableItem(formatbtn);
+ if(isCool)
+ {
+ EnableItem(resetpinbtn);
+ EnableItem(formatbtn);
+ }
+ else
+ {
+ DisableItem(resetpinbtn);
+ DisableItem(formatbtn);
+ }
if(!isBusy)
detailsKeyLabel.setAttribute("value",getBundleString("enrolledKey"));
@@ -2377,12 +2512,24 @@
if(keyStatus == "UNINITIALIZED")
{
DisableItem(viewcertsbtn);
- EnableItem(enrollbtn);
+
+ if(isCool)
+ {
+ EnableItem(enrollbtn);
+ }
+ else
+ {
+ DisableItem(enrollbtn);
+ }
+
DisableItem(resetpinbtn);
if(!isBusy)
detailsKeyLabel.setAttribute("value",getBundleString("uninitializedKey"));
- EnableItem(formatbtn);
+ if(isCool)
+ EnableItem(formatbtn);
+ else
+ DisableItem(formatbtn);
return;
}
@@ -2396,7 +2543,11 @@
if(!isBusy)
detailsKeyLabel.setAttribute("value",getBundleString("blankKey"));
- EnableItem(formatbtn);
+ if(isCool)
+ EnableItem(formatbtn);
+ else
+ DisableItem(formatbtn);
+
return;
}
@@ -2940,7 +3091,7 @@
var keyID = keyInfo[1];
var screenname = null;
- var pin = null;
+ var pin = GetPINValue();
var screennamepwd = null;
if (GetCoolKeyIsEnrolled(keyType, keyID))
@@ -3053,7 +3204,6 @@
function OnCoolKeyInserted(keyType, keyID)
{
-
var row = null;
var uninitialized = 0;
@@ -3088,20 +3238,27 @@
SelectRowByKeyID(keyType, keyID);
}
- DoPhoneHome(keyType,keyID);
+ var phoneHomeSuccess = 1;
+
+ if(DoGetCoolKeyIsReallyCoolKey(keyType, keyID))
+ phoneHomeSuccess = DoPhoneHome(keyType,keyID);
ShowAllWindows();
- SelectESCPage(uninitialized);
+ SelectESCPage(keyType,keyID,1 - phoneHomeSuccess);
UpdateESCSize();
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));
}
}
@@ -3195,6 +3352,9 @@
function OnCoolKeyPINResetComplete(keyType, keyID)
{
+ if(gHiddenPage)
+ return;
+
var keyStatus = PolicyToKeyType(GetCoolKeyPolicy(keyType, keyID));
var keyReqAuth = BoolToYesNoStr(GetCoolKeyRequiresAuth(keyType, keyID));
var keyIsAuthed = BoolToYesNoStr(GetCoolKeyIsAuthed(keyType, keyID));
@@ -3724,6 +3884,23 @@
return result;
}
+function DoGetCoolKeyIsReallyCoolKey(keyType,keyID)
+{
+
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ isCool = netkey.GetCoolKeyIsReallyCoolKey(keyType, keyID);
+
+ //alert("isCool " + isCool);
+
+ return isCool;
+ } catch (e) {
+
+ return 0;
+ }
+
+}
+
function DoCoolKeyGetIssuerUrl(keyType,keyID)
{
var url = null;
@@ -3749,6 +3926,19 @@
return url;
}
+function DoGetCoolKeyGetAppletVer(keyType, keyID , isMajor)
+{
+ var ver = -1;
+
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ var ver = netkey.GetCoolKeyGetAppletVer(keyType, keyID,isMajor);
+ } catch (e) {
+ ver = -1;
+ }
+ return ver;
+
+}
function CheckForFactoryMode()
{
@@ -3769,7 +3959,8 @@
function launchCertViewer()
{
- var wind = window.openDialog("chrome://pippki/content/certManager.xul", "","chrome,centerscreen,modal=yes");
+ var wind = window.openDialog("chrome://esc/content/certManager.xul", "","chrome,centerscreen,modal=yes");
+// var wind = window.openDialog("chrome://pippki/content/certManager.xul", "","chrome,centerscreen,modal=yes");
}
function launchSETTINGS()
@@ -3850,6 +4041,24 @@
//Utility DOM functions
+function ChangeDescription(theDesc,theNewText)
+{
+
+ if(!theDesc || !theNewText)
+ return;
+
+ RemoveAllChildNodes(theDesc);
+
+ var theLabel = document.createTextNode(theNewText);
+
+
+ theDesc.appendChild(theLabel);
+
+ UpdateESCSize();
+
+
+}
+
function HideItem(theItem)
{
if(theItem)
@@ -4223,3 +4432,54 @@
}
}
+
+
+//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()
+{
+ var textinfo = window.document.getElementById("advanced-info");
+
+
+ CopyDataToClipboard(gDiagnosticsDataText);
+}
+
+
+function CopyDataToClipboard(aDataText)
+{
+
+ if(!aDataText)
+ return;
+
+
+ var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
+
+
+ if (!str)
+ return false;
+
+ str.data = aDataText;
+
+ var trans = Components.classes["@mozilla.org/widget/transferable;1"]. createInstance(Components.interfaces.nsITransferable);
+
+ if (!trans)
+ return false;
+
+ 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") );
+
+}
Index: GenericAuth.js
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/GenericAuth.js,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- GenericAuth.js 13 Sep 2006 17:56:49 -0000 1.2
+++ GenericAuth.js 27 Sep 2006 17:31:51 -0000 1.3
@@ -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)
Index: GenericAuth.xul
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/GenericAuth.xul,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- GenericAuth.xul 12 Jun 2006 23:39:51 -0000 1.1.1.1
+++ GenericAuth.xul 27 Sep 2006 17:31:51 -0000 1.2
@@ -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">
Index: TRAY.js
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/TRAY.js,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- TRAY.js 13 Sep 2006 17:56:49 -0000 1.2
+++ TRAY.js 27 Sep 2006 17:31:51 -0000 1.3
@@ -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;
}
+
Index: config.xul
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/config.xul,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- config.xul 13 Sep 2006 17:56:49 -0000 1.2
+++ config.xul 27 Sep 2006 17:31:51 -0000 1.3
@@ -23,8 +23,8 @@
id="esc-window"
title="&escTitle;"
onload="InitializePhoneHomeConfigUI();"
- width ="600"
- height= "350"
+ width ="650"
+ height= "400"
onunload="cleanup();"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
@@ -40,6 +40,19 @@
&tpsConfigDesc;
+
+
+
+ &tpsConfigDesc1;
+
+
+
+ &tpsConfigDesc2;
+
+
+
+ &tpsConfigDesc3;
+
@@ -58,7 +71,7 @@
-
+
Index: esc.css
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/esc.css,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- esc.css 13 Sep 2006 17:56:49 -0000 1.2
+++ esc.css 27 Sep 2006 17:31:51 -0000 1.3
@@ -87,7 +87,7 @@
}
.messageText {
- font-size: 9pt;
+ font-size: 10pt;
text-align: justify;
}
@@ -313,6 +313,13 @@
background-color: #ffffff;
}
+.DiagnosicsTextBox {
+
+ width: 600px;
+ height: 725px;
+ border: black solid 4px;
+
+}
.BorderedIFrame {
@@ -339,8 +346,14 @@
width: 100px;
}
+.largeWideBox {
+
+ min-width: 42em;
+
+}
+
.mediumWideBox {
- min-width: 20em;
+ min-width: 18em;
}
Index: esc.xul
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/esc.xul,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- esc.xul 13 Sep 2006 17:56:49 -0000 1.2
+++ esc.xul 27 Sep 2006 17:31:51 -0000 1.3
@@ -71,7 +71,7 @@
-
+
&readyToProceed;
Index: settings.xul
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/settings.xul,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- settings.xul 13 Sep 2006 17:56:49 -0000 1.2
+++ settings.xul 27 Sep 2006 17:31:51 -0000 1.3
@@ -24,7 +24,7 @@
title="&escTitle;"
onload="InitializeAdminBindingList()"
onunload="cleanup()"
- width ="720"
+ width ="730"
height= "460"
name="admin"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
@@ -47,7 +47,7 @@
-
+
@@ -55,14 +55,15 @@
-
+
-
+
@@ -74,9 +75,9 @@
-
-
-
+
+
+
@@ -132,21 +133,25 @@
+
+
-
-
+
+
+
+
-
+
From fedora-directory-commits at redhat.com Wed Sep 27 17:42:41 2006
From: fedora-directory-commits at redhat.com (Jack Magne (jmagne))
Date: Wed, 27 Sep 2006 10:42:41 -0700
Subject: [Fedora-directory-commits] esc/rpm esc,1.1,1.2 esc.spec,1.1,1.2
Message-ID: <200609271742.k8RHgfkw027248@cvs-int.fedora.redhat.com>
Author: jmagne
Update of /cvs/dirsec/esc/rpm
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv27229
Modified Files:
esc esc.spec
Log Message:
Latest updates.
Index: esc
===================================================================
RCS file: /cvs/dirsec/esc/rpm/esc,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- esc 27 Sep 2006 17:19:19 -0000 1.1
+++ esc 27 Sep 2006 17:42:38 -0000 1.2
@@ -1,4 +1,21 @@
#!/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
ESC_PROFILE_BASE=~/.redhat/esc
ESC_LOG_FILE=esc.log
Index: esc.spec
===================================================================
RCS file: /cvs/dirsec/esc/rpm/esc.spec,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- esc.spec 27 Sep 2006 17:19:19 -0000 1.1
+++ esc.spec 27 Sep 2006 17:42:38 -0000 1.2
@@ -1,3 +1,22 @@
+# BEGIN COPYRIGHT BLOCK
+# Copyright (C) 2005 Red Hat, Inc.
+# All rights reserved.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation version
+# 2.1 of the License.
+#
+# This library 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+# END COPYRIGHT BLOCK
+
Name: esc
Version: 1.0.0
Release: 16%{?dist}
From fedora-directory-commits at redhat.com Wed Sep 27 17:44:34 2006
From: fedora-directory-commits at redhat.com (Jack Magne (jmagne))
Date: Wed, 27 Sep 2006 10:44:34 -0700
Subject: [Fedora-directory-commits] esc/src/app/xul/esc application.ini,
1.1.1.1, 1.2
Message-ID: <200609271744.k8RHiYmB027283@cvs-int.fedora.redhat.com>
Author: jmagne
Update of /cvs/dirsec/esc/src/app/xul/esc
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv27266
Modified Files:
application.ini
Log Message:
Latest updates.
Index: application.ini
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/application.ini,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- application.ini 12 Jun 2006 23:39:50 -0000 1.1.1.1
+++ application.ini 27 Sep 2006 17:44:31 -0000 1.2
@@ -25,20 +25,16 @@
Name=ESC
;
; This field specifies your application's version. This field is optional.
-Version=0.1
+Version=1.0.0
;
; This field specifies your application's build ID (timestamp). This field is
; required.
-BuildID=0000000000
-;
-; This field specifies a compact copyright notice for your application. This
-; field is optional.
-Copyright=Copyright (c) 2004 Mozilla.org
+BuildID=00000000016
;
; 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
; irc.mozilla.org and /msg botbot uuid. This field is optional.
-ID={777f7150-4a2b-4301-ad10-5eab25b322aa}
+ID={6380471b-1924-4b48-b652-49f42951af86}
[Gecko]
;
@@ -54,8 +50,3 @@
MaxVersion=1.9
[Shell]
-;
-; This field specifies the location of your application's main icon with file
-; extension excluded. NOTE: Unix style file separators are required. This
-; field is optional.
-Icon=chrome/icons/default/simple
From fedora-directory-commits at redhat.com Wed Sep 27 17:45:17 2006
From: fedora-directory-commits at redhat.com (Jack Magne (jmagne))
Date: Wed, 27 Sep 2006 10:45:17 -0700
Subject: [Fedora-directory-commits] esc/src/app/xul/esc/chrome/locale/en-US
esc.dtd, 1.2, 1.3 esc.properties, 1.2, 1.3
Message-ID: <200609271745.k8RHjH4M027315@cvs-int.fedora.redhat.com>
Author: jmagne
Update of /cvs/dirsec/esc/src/app/xul/esc/chrome/locale/en-US
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv27296
Modified Files:
esc.dtd esc.properties
Log Message:
Latest updates.
Index: esc.dtd
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/locale/en-US/esc.dtd,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- esc.dtd 13 Sep 2006 17:56:06 -0000 1.2
+++ esc.dtd 27 Sep 2006 17:45:14 -0000 1.3
@@ -28,13 +28,14 @@
+
-
-
+
+
@@ -57,7 +58,7 @@
-
+
@@ -70,13 +71,16 @@
-
+
-
-
+
+
-
+
+
+
+
Index: esc.properties
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/locale/en-US/esc.properties,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- esc.properties 13 Sep 2006 17:56:06 -0000 1.2
+++ esc.properties 27 Sep 2006 17:45:14 -0000 1.3
@@ -29,38 +29,60 @@
statusUninitialized=UNINITIALIZED
statusUnknown=UNKNOWN
statusBusy=BUSY
-unknownIssuer=Unknown Issuer
+unknownIssuer=Unknown
redHatUser=User
statusUnknown=Unknown
+appletVersion = Smart Card Applet Version:
+operationPINReset=Resetting Key Password..
+operationEnrollment=Enrolling Key..
+operationFormat=Formatting Key..
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.
-certsOnToken=CERTIFICATES on KEY
+escLogEntries=Smart Card Activity
+noLogFileOrData=No log file or log file has no data.
+dataCopiedToClipboard=Diagnostics information copied to the clipboard.
+diagnosticsReport=SMART CARD DIAGNOSTICS REPORT
+diagnosticsSystemInfo=Software Version Information
+diagnosticsSoftVersioInfo=System Versions:
+diagnosticsDetails=Active Smart Card Details
+secCard=Card
+certsOnToken=Certificates on Smart Card
certificateNickname=Certificate Nickname:
+certIssuedTo=Issued to;
+certIssuedBy=Issued by;
+certValidityFrom=Validity from:
+certValidityTo=Validity to:
+certSerialNumber=Serial number:
coolkeyComponentVersion=Smart Card Manager Version:
coolkeyDetectedNumberKeys=Number of Smart Cards Detected:
enrolledDetected=Enrolled Smart Card Detected
-enrolledDetectedMessage=Smart Card Manager has detected an enrolled card. If you would rather not re-enroll this card press "Close".
+enrolledDetectedMessage=Smart Card Manager has detected an already enrolled card. If you do not wish to re-enroll, press the "Close" button.
+unenrolledDetectedMessage=Smart Card Manager has detected that you have entered a new and un-enrolled smart card. Before you can use this smart card, you have to enroll it. Enrolling your smart card personalizes it so only you can use it for secure operations.
+enrollAnyway=If you would like to re-enroll anyway, click Enroll My Smart Card Now.
+readyToProceed=When you are ready to begin the process,click Enroll My Smart Card Now.
formatingToken=Formatting...
enrollingToken=Enrolling...
-resettingTokenPIN=Resetting Password...
-cancellingOperation=Cancelling...
-blinkingToken=Blinking...
+resettingTokenPIN=Password Reset..
+cancellingOperation=Cancelling..
+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.
-errorProblemResetTokenPin=Problem resetting smart card's pin.
+errorProblemResetTokenPin=Internal Smart Card Server error.
errorTokenEnrollment=Smart card enrollment error.
errorCommCA=Error communicating with the Certification Authority.
errorInternalServer=Internal Smart Card Server error.
@@ -75,7 +97,7 @@
errorCommTokenDB=Cannot communicate with smart card database.
errorPinReset=Cannot reset the password value for the smart card.
errorConnLost=Connection to Smart Card Server.
-errorEntryTokenDB=Can not create entry for smart card in smart card database.
+errorEntryTokenDB=Can not create entry for the smart card in the smart card database.
errorNoTokenState=Smart card found to be in an inconsistent state.
errorInvalidLostTokenReason=Invalid reason for lost smart card submitted.
errorTokenUnusable=Smart card found to be unusable due to compromise.
@@ -130,15 +152,15 @@
errorGetAvailCoolKeys=coolkey.GetAvailableCoolKeys() failed!
errorEnollCoolKey=coolkey.EnrollCoolKey() failed!
errorCoolKeyIsEnrolled=coolkey.GetCoolKeyIsEnrolled failed!
-errorResetCoolKeyPIN=coolkey.ResestCoolKeyPIN() failed! Make sure Smart card is properly Enrolled.
+errorResetCoolKeyPIN=coolkey.ResestCoolKeyPASSWORD() failed! Make sure smart card is enrolled.
errorFormatCoolKey=coolkey.FormatCoolKey() failed!
errorCancelCoolKey=coolkeyCancelCoolKeyOperation() failed!
errorBlinkCoolKey=coolkey.BlinkCoolKey() failes!
noCurrentlySelectedToken=No currently selected smart card!
errorProvideScreenName=You must provide a valid screen name!
-errorProvideTokenPIN=You must provide a valid TokenPIN!
-errorMatchPinValues=The PIN values you entered don't match!
-errorValidUserPassword=You must provide a valid User Password!
+errorProvideTokenPIN=You must provide a valid card password!
+errorMatchPinValues=The Password values you entered don't match!
+errorValidUserPassword=You must provide a valid user password!
errorSelectKey=Please select a smart card.
errorEnrolledFirst=Smart card must be enrolled first! Enroll card and try again.
enrollmentFor=Enrollment for
@@ -146,10 +168,10 @@
pinResetSuccessful=Password Reset was successfull!
formatOf=Format of
error=Error
-serverResponse= \n\n Server Response:
+serverResponse= Server Response:
enrollmentOfKey=Enrollment of smart card
formatingOfKey=Formatting of smart card
-pinResetOfKey=PIN Reset for smart card
+pinResetOfKey=Password Reset for smart card
operationForKey=Operation for smart card
failed=failed.
cancelled=cancelled.
From fedora-directory-commits at redhat.com Wed Sep 27 17:46:58 2006
From: fedora-directory-commits at redhat.com (Jack Magne (jmagne))
Date: Wed, 27 Sep 2006 10:46:58 -0700
Subject: [Fedora-directory-commits]
esc/src/app/xul/esc/chrome/icons/default esc-window.xpm, NONE, 1.1
Message-ID: <200609271746.k8RHkwes027358@cvs-int.fedora.redhat.com>
Author: jmagne
Update of /cvs/dirsec/esc/src/app/xul/esc/chrome/icons/default
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv27342
Added Files:
esc-window.xpm
Log Message:
Initial revision.
--- NEW FILE esc-window.xpm ---
/* XPM */
static char * esc_client_16_xpm[] = {
"16 16 129 2",
" c None",
". c #1C1C1C",
"+ c #101010",
"@ c #1D1D1D",
"# c #3B3B3B",
"$ c #4F4F4F",
"% c #6C6C6D",
"& c #8F9091",
"* c #484848",
"= c #0A0A0A",
"- c #323232",
"; c #3F3F3F",
"> c #95989E",
", c #9CA5B4",
"' c #A4B2C9",
") c #A9B9D3",
"! c #8A919C",
"~ c #393939",
"{ c #1A1A1A",
"] c #9C9C9D",
"^ c #B1B8C3",
"/ c #9CACC5",
"( c #97ACCD",
"_ c #9AAFD1",
": c #AABBD7",
"< c #AFBACB",
"[ c #4B515B",
"} c #434548",
"| c #585858",
"1 c #222222",
"2 c #AAB1BE",
"3 c #9CB1D3",
"4 c #B6C4D9",
"5 c #D0D4DA",
"6 c #D2D2D2",
"7 c #C2C2C2",
"8 c #606060",
"9 c #696969",
"0 c #909090",
"a c #6A6A6A",
"b c #626262",
"c c #242424",
"d c #232323",
"e c #A5AEBB",
"f c #B8C6DD",
"g c #D8D9DD",
"h c #B8B8B8",
"i c #B9B9B9",
"j c #AEAEAB",
"k c #4A4A44",
"l c #90908F",
"m c #51514A",
"n c #55533F",
"o c #5A5A55",
"p c #2B2B2B",
"q c #252525",
"r c #A4ACB9",
"s c #B8C6DE",
"t c #DADCDF",
"u c #C9C9C9",
"v c #C4C6CA",
"w c #7D7F7D",
"x c #6A5E29",
"y c #9D9781",
"z c #7C7763",
"A c #C2BF95",
"B c #87826E",
"C c #56523B",
"D c #15140D",
"E c #A2AAB7",
"F c #B7C6DF",
"G c #B4BED9",
"H c #B4BED6",
"I c #A1ADCE",
"J c #616873",
"K c #988420",
"L c #DBBF3F",
"M c #DAC571",
"N c #ECD056",
"O c #D4A83A",
"P c #BF8821",
"Q c #221805",
"R c #272727",
"S c #A1A9B5",
"T c #B1C2DD",
"U c #AAB9D9",
"V c #B2C0DD",
"W c #A5B7D5",
"X c #646F78",
"Y c #99831D",
"Z c #F0E67E",
"` c #C1C286",
" . c #342C06",
".. c #B18B11",
"+. c #DD9A13",
"@. c #261A03",
"#. c #262626",
"$. c #ABB0B8",
"%. c #B6C5DF",
"&. c #A1B2CE",
"*. c #8D9CB3",
"=. c #818A99",
"-. c #4D5051",
";. c #7D6512",
">. c #EBDC6E",
",. c #D8D893",
"'. c #64590D",
"). c #D8AE19",
"!. c #DD9B13",
"~. c #757576",
"{. c #727478",
"]. c #535456",
"^. c #424242",
"/. c #1E1E1E",
"(. c #030303",
"_. c #312504",
":. c #AE9C3A",
"<. c #DBD176",
"[. c #BCA313",
"}. c #D5A415",
"|. c #AF7B0F",
"1. c #201603",
"2. c #171717",
"3. c #0D0D0D",
"4. c #272209",
"5. c #2C2914",
"6. c #2D2604",
"7. c #2D2204",
"8. c #2B1F04",
" ",
" ",
" . + ",
" @ # $ % & * ",
" = - - ; > , ' ) ! ~ ",
" { ] ^ / ( _ : < [ } | 1 ",
" 1 2 3 4 5 6 7 8 9 0 a b c ",
" d e f g h i j k l m n o p ",
" q r s t u v w x y z A B C D ",
" q E F G H I J K L M N O P Q ",
" R S T U V W X Y Z ` ...+. at . ",
" #.$.%.&.*.=.-.;.>.,.'.).!. at . ",
" @ ~.{.].^./.(._.:.<.[.}.|.1. ",
" = 2.3.{. 4.5.6.7.8. ",
" ",
" "};
From fedora-directory-commits at redhat.com Wed Sep 27 17:47:49 2006
From: fedora-directory-commits at redhat.com (Jack Magne (jmagne))
Date: Wed, 27 Sep 2006 10:47:49 -0700
Subject: [Fedora-directory-commits]
esc/src/lib/coolkey CoolKey.cpp, 1.1.1.1,
1.2 CoolKey.h, 1.1.1.1, 1.2 CoolKeyHandler.cpp, 1.1.1.1,
1.2 CoolKeyHandler.h, 1.1.1.1, 1.2 CoolKey_Message.cpp,
1.1.1.1, 1.2 NSSManager.cpp, 1.1.1.1, 1.2 NSSManager.h,
1.1.1.1, 1.2 SlotUtils.cpp, 1.1.1.1, 1.2 SlotUtils.h, 1.1.1.1,
1.2 SmartCardMonitoringThread.cpp, 1.1.1.1, 1.2 ckymanager.def,
1.1.1.1, 1.2 manifest.mn, 1.1.1.1, 1.2
Message-ID: <200609271747.k8RHlnNS027405@cvs-int.fedora.redhat.com>
Author: jmagne
Update of /cvs/dirsec/esc/src/lib/coolkey
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv27376
Modified Files:
CoolKey.cpp CoolKey.h CoolKeyHandler.cpp CoolKeyHandler.h
CoolKey_Message.cpp NSSManager.cpp NSSManager.h SlotUtils.cpp
SlotUtils.h SmartCardMonitoringThread.cpp ckymanager.def
manifest.mn
Log Message:
Latest updates.
Index: CoolKey.cpp
===================================================================
RCS file: /cvs/dirsec/esc/src/lib/coolkey/CoolKey.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- CoolKey.cpp 12 Jun 2006 23:39:52 -0000 1.1.1.1
+++ CoolKey.cpp 27 Sep 2006 17:47:46 -0000 1.2
@@ -15,14 +15,8 @@
* All rights reserved.
* END COPYRIGHT BLOCK **/
-//#ifdef WIN32
-//#include "windows.h"
-//#include "CoolKeyCSP.h"
-//#define ENABLE_CSP
-//#endif
+#define FORCE_PR_LOG 1
-#include "CoolKey.h"
-#include "CoolKeyPref.h"
#include "SlotUtils.h"
#include "prthread.h"
@@ -38,10 +32,10 @@
#include
#include
#include
-
+#include "CoolKey.h"
static NSSManager* g_NSSManager = NULL;
-static PRLogModuleInfo *coolKeyLog = PR_NewLogModule("netkey");
+static PRLogModuleInfo *coolKeyLog = PR_NewLogModule("coolKeyLib");
static std::list g_Listeners;
@@ -70,18 +64,17 @@
if (!g_NSSManager)
{
- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("CoolKeyInit:Failed to create NSSManager.\n"));
+ PR_LOG( coolKeyLog, PR_LOG_ERROR, ("CoolKeyInit:Failed to create NSSManager.\n"));
return E_FAIL;
}
HRESULT rv = g_NSSManager->InitNSS(aAppDir);
if (rv == E_FAIL)
{
- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("CoolKeyInit:Failed to Init NSSManager. \n"));
+ PR_LOG( coolKeyLog, PR_LOG_ERROR, ("Failed to initialize Crypto library! \n"));
return rv;
}
-
return S_OK;
}
@@ -89,14 +82,6 @@
{
PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("CoolKeyShutdown:\n"));
-// ShutdownUIThreadProxyService();
-
- std::list::iterator it;
- for (it=g_Listeners.begin(); it!=g_Listeners.end(); ++it)
- {
- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("CoolKeyShutdown: listener still in list %p\n",(*it)));
- }
-
DestroyCoolKeyList();
if (g_NSSManager) {
@@ -105,10 +90,6 @@
g_NSSManager = 0;
}
- //DestroyCoolKeyList();
-
- CoolKeyPrefShutdown();
-
return S_OK;
}
@@ -118,6 +99,8 @@
static CoolKeyGetConfigValue g_GetConfigValue = NULL;
static CoolKeySetConfigValue g_SetConfigValue = NULL;
+char* CoolKeyVerifyPassword(PK11SlotInfo *,PRBool,void *);
+
COOLKEY_API HRESULT CoolKeySetCallbacks(CoolKeyDispatch dispatch,
CoolKeyReference reference, CoolKeyRelease release,
CoolKeyGetConfigValue getconfigvalue,CoolKeySetConfigValue setconfigvalue)
@@ -127,6 +110,10 @@
g_Release = release;
g_GetConfigValue = getconfigvalue;
g_SetConfigValue = setconfigvalue;
+
+
+ PK11_SetPasswordFunc( CoolKeyVerifyPassword);
+ // Set the verify password callback here, no params needed we know what it is
return 0;
}
@@ -140,6 +127,11 @@
(*g_Reference)(list); \
}
+char *CoolKeyVerifyPassword(PK11SlotInfo *slot,PRBool retry,void *arg)
+{
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("CoolKeyVerifyPassword: \n"));
+ return NULL;
+}
COOLKEY_API HRESULT CoolKeyRegisterListener(CoolKeyListener* aListener)
{
@@ -169,7 +161,6 @@
PR_LOG( coolKeyLog, PR_LOG_DEBUG,
("CoolKeyUnregisterListener: erasing listener %p \n",*it));
- //CoolKeyListener *listener = *it;
g_Listeners.erase(it);
RELEASE_LISTENER(aListener);
}
@@ -196,9 +187,6 @@
}
}
- PR_LOG( coolKeyLog, PR_LOG_DEBUG,
- ("CoolKeyNotify: leaving: key %s state %d data %d",
- aKey->mKeyID, aKeyState, aData));
return S_OK;
}
@@ -831,7 +819,7 @@
}
- return S_OK; // NSSManager::GetKeyCertInfo(aKey,aCertNickname,aCertInfo);
+ return NSSManager::GetKeyCertInfo(aKey,aCertNickname,aCertInfo);
}
@@ -843,6 +831,178 @@
return NSSManager::GetKeyPolicy(aKey, aBuf, aBufLen);
}
+HRESULT
+CoolKeyGetIssuedTo(const CoolKey *aKey, char *aBuf, int aBufLength)
+{
+ if (!aKey || !aKey->mKeyID || !aBuf || aBufLength < 1)
+ return E_FAIL;
+
+ return NSSManager::GetKeyIssuedTo(aKey,aBuf,aBufLength);
+
+}
+HRESULT CoolKeyGetIssuerInfo(const CoolKey *aKey, char *aBuf, int aBufLen)
+{
+ if (!aKey || !aKey->mKeyID || !aBuf || aBufLen < 1)
+ return E_FAIL;
+
+ aBuf[0] = 0;
+
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("CoolKeyGetIssuerInfo::\n"));
+
+ CKYBuffer ISSUER_INFO;
+ CKYBuffer_InitEmpty(&ISSUER_INFO);
+ CKYCardConnection *conn = NULL;
+ CKYISOStatus apduRC = 0;
+ CKYStatus status;
+ const char *readerName = NULL;
+ const CKYByte *infoData = NULL;
+ CKYSize infoSize = 0;
+
+ HRESULT result = S_OK;
+
+
+ CKYCardContext *cardCtxt = CKYCardContext_Create(SCARD_SCOPE_USER);
+
+ assert(cardCtxt);
+ if (!cardCtxt) {
+ PR_LOG( coolKeyLog, PR_LOG_ERROR, ("Attempting to get key issuer info. Can't create Card Context !.\n"));
+ result = E_FAIL;
+ goto done;
+ }
+
+ conn = CKYCardConnection_Create(cardCtxt);
+ assert(conn);
+ if (!conn) {
+ PR_LOG( coolKeyLog, PR_LOG_ERROR, ("Attempting to get key issuer info. Can't create Card Connection!\n"));
+ result = E_FAIL;
+ goto done;
+ }
+
+ readerName = GetReaderNameForKeyID(aKey);
+ assert(readerName);
+ if (!readerName) {
+ PR_LOG( coolKeyLog, PR_LOG_ERROR, ("Attempting to get key issuer info. Can't get reader name!\n"));
+ result = E_FAIL;
+ goto done;
+ }
+
+ status = CKYCardConnection_Connect(conn, readerName);
+ if (status != CKYSUCCESS) {
+ PR_LOG( coolKeyLog, PR_LOG_ERROR, ("Attempting to get key issuer info. Can't connect to Card!\n"));
+
+ result = E_FAIL;
+ goto done;
+ }
+
+CKYCardConnection_BeginTransaction(conn);
+ apduRC = 0;
+ status = CKYApplet_SelectCoolKeyManager(conn, &apduRC);
+ if (status != CKYSUCCESS) {
+
+ PR_LOG( coolKeyLog, PR_LOG_ERROR, ("Attempting to get key issuer info. Can't select CoolKey manager!\n"));
+ goto done;
+ }
+
+ status = CKYApplet_GetIssuerInfo(conn, &ISSUER_INFO,
+ &apduRC);
+
+ if(status != CKYSUCCESS)
+ {
+ PR_LOG( coolKeyLog, PR_LOG_ERROR, ("Attempting to get key issuer info. Error actually getting IssuerInfo!\n"));
+ result = E_FAIL;
+ goto done;
+ }
+
+ infoSize = CKYBuffer_Size(&ISSUER_INFO);
+
+ if(infoSize == 0)
+ {
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("CoolKeyGetIssuerInfo:: IssuerInfo buffer size is zero!\n"));
+ result = E_FAIL;
+ goto done;
+ }
+
+ if(infoSize >= (CKYSize ) aBufLen)
+ {
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("CoolKeyGetIssuerInfo:: Insufficient space to put Issuer Info!\n"));
+
+ result = E_FAIL;
+ goto done;
+ }
+
+ infoData = CKYBuffer_Data(&ISSUER_INFO);
+
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("CoolKeyGetIssuerInfo:: IssuerInfo actual data %s!\n",(char *) infoData));
+ if(infoData)
+ {
+ strcpy((char *) aBuf, (char *) infoData);
+ }
+
+ done:
+
+ if (conn) {
+ CKYCardConnection_EndTransaction(conn);
+ CKYCardConnection_Disconnect(conn);
+ CKYCardConnection_Destroy(conn);
+ }
+ if (cardCtxt) {
+ CKYCardContext_Destroy(cardCtxt);
+ }
+
+ CKYBuffer_FreeData(&ISSUER_INFO);
+
+ return result;
+}
+
+bool CoolKeyIsReallyCoolKey(const CoolKey *aKey)
+{
+ bool res = false;
+
+ if(!aKey)
+ return res;
+
+
+ CoolKeyInfo *info =
+ GetCoolKeyInfoByKeyID(aKey);
+
+ if(!info)
+ return res;
+
+ if( IS_REALLY_A_COOLKEY(info->mInfoFlags))
+ res = true;
+
+ return res;
+}
+
+int CoolKeyGetAppletVer(const CoolKey *aKey, const bool isMajor)
+{
+
+ int result = -1;
+ if(!aKey)
+ return result;
+
+ CoolKeyInfo *info =
+ GetCoolKeyInfoByKeyID(aKey);
+
+ if(!info)
+ return result;
+
+ PK11SlotInfo *slot = GetSlotForKeyID(aKey);
+
+ if(!slot)
+ return result;
+
+ CK_TOKEN_INFO tokenInfo;
+ PK11_GetTokenInfo(slot, &tokenInfo);
+
+ if(isMajor)
+ result = (int) tokenInfo.firmwareVersion.major;
+ else
+ result = (int) tokenInfo.firmwareVersion.minor;
+
+ return result;
+
+}
bool
Index: CoolKey.h
===================================================================
RCS file: /cvs/dirsec/esc/src/lib/coolkey/CoolKey.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- CoolKey.h 12 Jun 2006 23:39:52 -0000 1.1.1.1
+++ CoolKey.h 27 Sep 2006 17:47:46 -0000 1.2
@@ -120,6 +120,8 @@
COOLKEY_API bool CoolKeyHasApplet(const CoolKey *aKey);
COOLKEY_API bool CoolKeyIsEnrolled(const CoolKey *aKey);
COOLKEY_API bool CoolKeyHasReader(const CoolKey *aKey);
+COOLKEY_API bool CoolKeyIsReallyCoolKey(const CoolKey *aKey);
+
COOLKEY_API bool CoolKeyAuthenticate(const CoolKey *aKey, const char *aPIN);
COOLKEY_API HRESULT CoolKeyGenerateRandomData(unsigned char *aBuf, int aBufLen);
COOLKEY_API HRESULT CoolKeyGetSignatureLength(const CoolKey *aKey, int *aLength);
@@ -133,6 +135,8 @@
COOLKEY_API HRESULT CoolKeyGetCertInfo(const CoolKey *aKey, char *aCertNickname, std::string & aCertInfo);
+COOLKEY_API HRESULT CoolKeyGetIssuedTo(const CoolKey *aKey, char *aBuf, int aBufLength);
+
COOLKEY_API bool CoolKeyRequiresAuthentication(const CoolKey *aKey);
COOLKEY_API bool CoolKeyIsAuthenticated(const CoolKey *aKey);
@@ -165,6 +169,11 @@
COOLKEY_API HRESULT CoolKeySetDataValue(const CoolKey *aKey,const char *name, const char *value);
+
+COOLKEY_API HRESULT CoolKeyGetIssuerInfo(const CoolKey *aKey, char *aBuf, int aBufLen);
+
+COOLKEY_API int CoolKeyGetAppletVer(const CoolKey *aKey, const bool isMajor);
+
}
////////////////////////////////////////////////////////////////////////
Index: CoolKeyHandler.cpp
===================================================================
RCS file: /cvs/dirsec/esc/src/lib/coolkey/CoolKeyHandler.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- CoolKeyHandler.cpp 12 Jun 2006 23:39:51 -0000 1.1.1.1
+++ CoolKeyHandler.cpp 27 Sep 2006 17:47:46 -0000 1.2
@@ -15,11 +15,12 @@
* All rights reserved.
* END COPYRIGHT BLOCK **/
+#define FORCE_PR_LOG 1
+
#include
#include
#include
#include
-//#include
#include "prprf.h"
#include "nss.h"
@@ -35,7 +36,6 @@
#include "CoolKeyID.h"
#include "CoolKey.h"
-#include "CoolKeyPref.h"
#include "cky_base.h"
#include "cky_applet.h"
@@ -55,7 +55,7 @@
#define CKA_MOZILLA_ATR (CKO_NETSCAPE+25)
#endif
-static PRLogModuleInfo *coolKeyLogHN = PR_NewLogModule("netkey");
+static PRLogModuleInfo *coolKeyLogHN = PR_NewLogModule("coolKeyHandler");
void NotifyEndResult(CoolKeyHandler* context, int operation, int result, int description);
@@ -446,7 +446,7 @@
const char *tokenCode,int op) {
int error_no = 0;
- int config_error_no = 44;
+ int config_error_no = CONFIG_ERROR;
PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::Init:\n"));
@@ -455,7 +455,7 @@
const char *readerName = NULL;
if (!aKey || aKey->mKeyType != eCKType_CoolKey || !aKey->mKeyID) {
- PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::Init: failure 1\n"));
+ PR_LOG( coolKeyLogHN, PR_LOG_ERROR, ("Cannot begin CoolKey operation. Insuficient input parameters. \n"));
goto done;
}
@@ -468,14 +468,14 @@
if (!readerName) {
- PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::Init: failure 2\n"));
+ PR_LOG( coolKeyLogHN, PR_LOG_ERROR, ("Cannot begin CoolKey operation. Cannot locate card reader name! \n"));
goto done;
}
mDataLock = PR_NewLock();
if (!mDataLock)
{
- PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::Init: failure Can't initialize Lock for data.\n"));
+ PR_LOG( coolKeyLogHN, PR_LOG_ERROR, ("Cannot begin CoolKey operation. Cannnot initialize internal locking mechanism.\n"));
return E_FAIL;
}
@@ -483,41 +483,36 @@
mDataCondVar = PR_NewCondVar(mDataLock);
if (!mDataCondVar)
{
- PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::Init: failure Can't initialize Cond Var for data.\n"));
+ PR_LOG( coolKeyLogHN, PR_LOG_ERROR, ("Cannot begin CoolKey operation. Cannot initialize internal syncronization mechanism.\n"));
return E_FAIL;
}
CollectPreferences();
-
mHttpDisconnected = false;
mCancelled = false;
- //CoolKeyGetPref("TPS_HOST_USES_SSL", &temp);
-
-
if(!mCharHostName || !mRAUrl)
{
- PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::Init: Didn't collect proper config info..\n"));
+ PR_LOG( coolKeyLogHN, PR_LOG_ERROR, ("Cannot begin CoolKey operation. Didn't collect proper config information.\n"));
error_no = config_error_no;
goto done;
}
-
PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::Init: Past configuration tests, about to attempt operation.\n"));
mCardContext = CKYCardContext_Create(SCARD_SCOPE_USER);
if (!mCardContext) {
- PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::Init: failure 3\n"));
- error_no = 45;
+ PR_LOG( coolKeyLogHN, PR_LOG_ERROR, ("Cannot begin CoolKey operation. Cannot create card context! \n"));
+ error_no = CARD_CONTEXT_ERROR;
goto done;
}
mPDUWriter = new PDUWriterThread(this);
if (!mPDUWriter) {
- error_no = 46;
- PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::Init: failure 4\n"));
+ error_no = PDU_WRITER_ERROR;
+ PR_LOG( coolKeyLogHN, PR_LOG_ERROR, ("Cannot begin CoolKey operation. Cannot create internal PDU writer thread!\n"));
goto done;
}
@@ -528,8 +523,8 @@
if(mHttp_handle <= 0)
{
- PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::Init: failure 5\n"));
- error_no = 47;
+ PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("Cannot begin CoolKey operation. Can't create internal Http Client!\n"));
+ error_no = HTTP_CLIENT_ERROR;
goto done;
}
@@ -537,8 +532,8 @@
connected = ConnectToReader(readerName);
if (!connected) {
- PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::Init: failure 6\n"));
- error_no = 48;
+ PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("Cannot begin CoolKey operation. Can't connect to card reader!\n"));
+ error_no = CONN_READER_ERROR;
goto done;
}
@@ -569,12 +564,8 @@
CKYCardContext_Destroy(mCardContext);
mCardContext = 0;
}
- PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::Init: failure 7\n"));
-
-
- NotifyEndResult(this, op, 1, error_no);
- PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::Init: failure attempted to NotifyEndResult error no %d\n",error_no));
+ NotifyEndResult(this, op, 1, error_no);
return E_FAIL;
}
@@ -586,22 +577,27 @@
{
PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::CollectPreferences !\n"));
+ //Grab the keyID which we will need
- int httpMessageTimeout = 30;
+ const char *keyID = mKey.mKeyID;
+ if(!keyID)
+ {
+ PR_LOG( coolKeyLogHN, PR_LOG_ERROR,("Collecting CoolKey preferences. Cannot get keyID , cannot proceed. \n"));
- //Quickly grab the configurable http message timeout
+ return;
+ }
+
+ int httpMessageTimeout = 30;
+ //Quickly grab the configurable http message timeout
const char *msg_timeout = CoolKeyGetConfig("esc.tps.message.timeout");
-
if(msg_timeout)
{
-
httpMessageTimeout = atoi(msg_timeout);
-
PR_LOG( coolKeyLogHN, PR_LOG_DEBUG,("CoolKeyHandler::CollectPreferences! Message timeout %d\n",httpMessageTimeout));
}
@@ -610,12 +606,27 @@
// Now grab the url for the tps server from config store.
- const char *tps_url = CoolKeyGetConfig("esc.tps.url");
+ string tps_operation = "Operation";
+
+ string tps_url_for_key = tps_operation + "-" + keyID;
+
+ const char *tps_url_for_key_str = tps_url_for_key.c_str();
+
+ PR_LOG( coolKeyLogHN, PR_LOG_DEBUG,("CoolKeyHandler::CollectPreferences! tps_url %s\n",tps_url_for_key_str));
+ const char *tps_url = CoolKeyGetConfig(tps_url_for_key_str);
if(!tps_url)
{
- PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::CollectPreferences Can't find value for esc.tps.url \n"));
- return;
+ //now try to get the hard coded entry out of the config file.
+
+ tps_url = CoolKeyGetConfig("esc.tps.url");
+
+ if(!tps_url)
+ {
+ PR_LOG( coolKeyLogHN, PR_LOG_ERROR, ("Collecting CoolKey preferences. Cannot find value for the TPS URL. \n"));
+
+ return;
+ }
}
PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::CollectPreferences esc.tps.url %s\n",tps_url));
@@ -642,7 +653,7 @@
pos = tps_url_str.find(non_ssl_str,0);
if(pos == string::npos)
{
- PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::CollectPreferences esc.tps.url illegal protocol! \n"));
+ PR_LOG( coolKeyLogHN, PR_LOG_ERROR, ("Collecting CoolKey preferences. TPS URL has specified an illegal protocol! \n"));
return;
}
@@ -685,7 +696,7 @@
if(!host_name_port_str.length())
{
- PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::CollectPreferences Bad hostname and port sttring!.\n"));
+ PR_LOG( coolKeyLogHN, PR_LOG_ERROR, ("Collecting CoolKey preferences. Bad hostname and port value!.\n"));
return;
}
@@ -811,7 +822,7 @@
HRESULT CoolKeyHandler::SetPassword(const char *password)
{
- PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::CloseConnection:\n"));
+ PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::SetPassword:\n"));
PR_Lock(mDataLock);
if(!mCharScreenNamePwd)
@@ -1162,7 +1173,7 @@
string ext_buffer = "";
- char *clientVer = "ESC 1.1";
+ char *clientVer = "ESC 1.0.0";
sprintf(buffer,"clientVersion=%s",clientVer);
ext_buffer = buffer;
@@ -1224,23 +1235,25 @@
void CoolKeyHandler::HttpProcessTokenPDU(CoolKeyHandler *context,eCKMessage_TOKEN_PDU_REQUEST *req)
{
- PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::ProcessTokenPDU:\n"));
- if(!req)
- {
- return;
- }
-
- int size = 4096;
- unsigned char pduData[4096];
-
+ PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::ProcessTokenPDU:\n"));
+ if(!req || !context)
+ {
+ PR_LOG( coolKeyLogHN, PR_LOG_ERROR, ("Processing HTTP message. Bad input data. \n"));
+ context->HttpOnDisconnect();
+ return;
+ }
- req->getPduData(pduData,&size);
+ int size = 4096;
+ unsigned char pduData[4096];
+ req->getPduData(pduData,&size);
- if(size == 0)
- {
- return;
- }
+ if(size == 0)
+ {
+ PR_LOG( coolKeyLogHN, PR_LOG_ERROR, ("Processing HTTP message. Can't extract PDU data from message! \n"));
+ context->HttpOnDisconnect();
+ return;
+ }
// Send the PDU to the token
@@ -1250,56 +1263,61 @@
// structure is a C struct that contains a single member
// which just so happens to be an CKYBuffer.
- AutoCKYBuffer pduBuffer(pduData, size);
- CKYAPDU *requestAPDU = (CKYAPDU*)((CKYBuffer*)&pduBuffer);
+ AutoCKYBuffer pduBuffer(pduData, size);
+ CKYAPDU *requestAPDU = (CKYAPDU*)((CKYBuffer*)&pduBuffer);
- // XXX
+ AutoCKYBuffer response;
-
- AutoCKYBuffer response;
-
- CKYStatus status = CKYCardConnection_ExchangeAPDU(context->GetCardConnection(),
+ CKYStatus status = CKYCardConnection_ExchangeAPDU(context->GetCardConnection(),
requestAPDU, &response);
-
- if (status != CKYSUCCESS) {
- return;
- }
-
- eCKMessage_TOKEN_PDU_RESPONSE pdu_response;
+ if (status != CKYSUCCESS) {
+ PR_LOG( coolKeyLogHN, PR_LOG_ERROR,
+ ("Processing HTTP message. Can't write apdu to card! status %d response[0] %x response[1] %x error %d \n"
+ ,status,CKYBuffer_GetChar(&response,0),CKYBuffer_GetChar(&response,1),
+ CKYCardConnection_GetLastError(context->GetCardConnection())));
- int pduSizeRet = (MESSAGE_u08) CKYBuffer_Size(&response);
- MESSAGE_byte *pduDataRet = (MESSAGE_byte *) CKYBuffer_Data(&response);
+ context->HttpOnDisconnect();
- if(pduSizeRet == 0 || !pduDataRet)
- {
- return;
- }
+ return;
+ }
+
+ eCKMessage_TOKEN_PDU_RESPONSE pdu_response;
- pdu_response.setPduData(pduDataRet,pduSizeRet);
+ int pduSizeRet = (MESSAGE_u08) CKYBuffer_Size(&response);
+ MESSAGE_byte *pduDataRet = (MESSAGE_byte *) CKYBuffer_Data(&response);
- string output = "";
+ if(pduSizeRet == 0 || !pduDataRet)
+ {
+ PR_LOG( coolKeyLogHN, PR_LOG_ERROR, ("Processing HTTP message. No PDU response from card! \n"));
+ context->HttpOnDisconnect();
+ return;
+ }
- pdu_response.encode(output);
-
- NSS_HTTP_HANDLE handle = context->getHttpHandle();
+ pdu_response.setPduData(pduDataRet,pduSizeRet);
+ string output = "";
- if(handle && output.size())
- {
- PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::sending to RA: %s \n",output.c_str()));
- NSS_HTTP_RESULT res = sendChunkedEntityData(output.size(),(unsigned char *) output.c_str(),handle);
+ pdu_response.encode(output);
+
+ NSS_HTTP_HANDLE handle = context->getHttpHandle();
- if(res == 0)
- {
- PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::write back to RA failed , disconnecting: \n"));
+ if(handle && output.size())
+ {
+ PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::sending to RA: %s \n",output.c_str()));
+ NSS_HTTP_RESULT res = sendChunkedEntityData(output.size(),(unsigned char *) output.c_str(),handle);
- context->CloseConnection();
- context->HttpOnDisconnect();
-
- }
+ if(res == 0)
+ {
+ PR_LOG( coolKeyLogHN, PR_LOG_ERROR, ("Processing HTTP message. Write back to TPS failed , disconnecting. \n"));
+ context->HttpOnDisconnect();
+ }
+ else
+ {
+ PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler:ProcessTokenPDU data written to RA .\n"));
+ }
- }
- return;
}
+
+}
HRESULT CoolKeyHandler::HttpProcessStatusUpdate(eCKMessage_STATUS_UPDATE_REQUEST * msg)
{
@@ -1624,25 +1642,33 @@
switch (operation) {
case ENROLL:
if (result == 0) {
+
+ PR_LOG( coolKeyLogHN, PR_LOG_ALWAYS, ("Key Enrollment success.\n"));
CoolKeyAuthenticate(context->GetAutoCoolKey(), context->GetPIN());
CoolKeyNotify(context->GetAutoCoolKey(), eCKState_EnrollmentComplete,
context->GetScreenName() == NULL ? 1 : 0);
} else {
+ PR_LOG( coolKeyLogHN, PR_LOG_ALWAYS, ("Key Enrollment failure. Error: %d.\n",description));
CoolKeyNotify(context->GetAutoCoolKey(), eCKState_EnrollmentError, description); // XXX: Need INIT_FAILED error code!
}
break;
case RESET_PIN:
if (result == 0) {
+
+ PR_LOG( coolKeyLogHN, PR_LOG_ALWAYS, ("Key Reset Password success.\n"));
CoolKeyAuthenticate(context->GetAutoCoolKey(), context->GetPIN());
CoolKeyNotify(context->GetAutoCoolKey(), eCKState_PINResetComplete, 0);
} else {
+ PR_LOG( coolKeyLogHN, PR_LOG_ALWAYS, ("Key Reset Password failure. Error: %d.\n",description));
CoolKeyNotify(context->GetAutoCoolKey(), eCKState_PINResetError, description); // XXX: Need PIN_RESET_FAILED error code!
}
break;
case FORMAT:
if (result == 0) {
+ PR_LOG( coolKeyLogHN, PR_LOG_ALWAYS, ("Key Format success.\n"));
CoolKeyNotify(context->GetAutoCoolKey(), eCKState_FormatComplete, 0);
} else {
+ PR_LOG( coolKeyLogHN, PR_LOG_ALWAYS, ("Key Format failure. Error: %d.\n",description));
CoolKeyNotify(context->GetAutoCoolKey(), eCKState_FormatError, description); // XXX: Need FORMAT_FAILED error code!
}
break;
@@ -1981,6 +2007,7 @@
if (tokenInfo->flags & CKF_TOKEN_INITIALIZED) {
mask |= COOLKEY_INFO_IS_PERSONALIZED_MASK;
}
+
return mask;
}
@@ -2059,6 +2086,7 @@
if (status != SECSuccess) {
return 0;
}
+
return MapGetFlags(&tokenInfo);
}
@@ -2075,9 +2103,14 @@
HRESULT hres;
int atrSize;
char *atrString;
+ SECItem isCOOLKey;
ATR.data = NULL; // initialize for error processing
label.data = NULL; // initialize for error processing
+ isCOOLKey.data = NULL;
+
+
+ int isACOOLKey = 0;
/* if it's one of "ours" it'll have a reader object */
obj = PK11_FindGenericObjects(aSlot, CKO_MOZILLA_READER);
@@ -2093,8 +2126,7 @@
// get the ATR (though, again, we probably don't need it
status = PK11_ReadRawAttribute(PK11_TypeGeneric, obj, CKA_MOZILLA_ATR, &ATR);
- PK11_DestroyGenericObjects(obj);
- obj = NULL;
+ // PK11_DestroyGenericObjects(obj);
if (status != SECSuccess) {
goto failed;
}
@@ -2104,6 +2136,34 @@
goto failed;
}
+ //get the are we a CoolKey value
+
+ status = PK11_ReadRawAttribute(PK11_TypeGeneric, obj, CKA_MOZILLA_IS_COOL_KEY, &isCOOLKey);
+
+ PK11_DestroyGenericObjects(obj);
+ obj = NULL;
+
+ if (status != SECSuccess) {
+ goto failed;
+ }
+
+ if(isCOOLKey.len == 1)
+ {
+ PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CKHGetCoolKeyInfo: CKA_MOZILLA_IS_COOL_KEY %d.\n",(int) isCOOLKey.data[0]));
+
+ isACOOLKey=(int) isCOOLKey.data[0];
+ }
+
+ PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CKHGetCoolKeyInfo: info->flags %u.\n",tokenInfo.flags));
+
+ PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CKHGetCoolKeyInfo: info->label %s.\n",(char *)tokenInfo.label));
+ PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CKHGetCoolKeyInfo: info->manufacturerID %s.\n",(char *)tokenInfo.manufacturerID));
+ PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CKHGetCoolKeyInfo: info->model %s.\n",(char *)tokenInfo.model));
+ PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CKHGetCoolKeyInfo: info->serialNumber %s.\n",(char *)tokenInfo.serialNumber));
+
+ PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CKHGetCoolKeyInfo: info->firmwareVersion.major %d info->firmwareVersion.minor %d \n",(int)tokenInfo.firmwareVersion.major,(int) tokenInfo.firmwareVersion.minor));
+
+
// OK, we have everything we need, now build the COOLKEYInfo structure.
info = new CoolKeyInfo();
if (!info) {
@@ -2122,6 +2182,10 @@
SECITEM_FreeItem(&ATR,PR_FALSE);
ATR.data = NULL;
+
+ PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CKHGetCoolKeyInfo: info->atr %s.\n",(char *)atrString));
+
+
info->mATR = atrString;
info->mReaderName= (char *)malloc(label.len+1);
if (!info->mReaderName) {
@@ -2130,6 +2194,12 @@
memcpy(info->mReaderName, label.data, label.len);
info->mReaderName[label.len] = 0;
info->mInfoFlags = MapGetFlags(&tokenInfo);
+
+ //Handle the isCOOLKey flag
+ if(isACOOLKey) {
+ info->mInfoFlags |= COOLKEY_INFO_IS_REALLY_A_COOLKEY_MASK;
+ }
+
info->mCUID = (char *)malloc(35); /* should be a define ! */
if (!info->mCUID) {
goto failed;
@@ -2142,6 +2212,8 @@
SECITEM_FreeItem(&ATR,PR_FALSE);
SECITEM_FreeItem(&label,PR_FALSE);
+ SECITEM_FreeItem(&isCOOLKey,PR_FALSE);
+
info->mSlot = PK11_ReferenceSlot(aSlot);
info->mSeries = PK11_GetSlotSeries(aSlot);
return info;
Index: CoolKeyHandler.h
===================================================================
RCS file: /cvs/dirsec/esc/src/lib/coolkey/CoolKeyHandler.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- CoolKeyHandler.h 12 Jun 2006 23:39:51 -0000 1.1.1.1
+++ CoolKeyHandler.h 27 Sep 2006 17:47:46 -0000 1.2
@@ -95,6 +95,15 @@
FORMAT
};
+enum {
+ CONFIG_ERROR = 44,
+ CARD_CONTEXT_ERROR,
+ PDU_WRITER_ERROR,
+ HTTP_CLIENT_ERROR,
+ CONN_READER_ERROR
+
+};
+
class CoolKeyHandler
{
public:
Index: CoolKey_Message.cpp
===================================================================
RCS file: /cvs/dirsec/esc/src/lib/coolkey/CoolKey_Message.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- CoolKey_Message.cpp 12 Jun 2006 23:39:52 -0000 1.1.1.1
+++ CoolKey_Message.cpp 27 Sep 2006 17:47:46 -0000 1.2
@@ -15,12 +15,14 @@
* All rights reserved.
* END COPYRIGHT BLOCK **/
+#define FORCE_PR_LOG 1
+
#include "nspr.h"
#include "CoolKey_Message.h"
#include "math.h"
#include
-PRLogModuleInfo *nkeyLogMS = PR_NewLogModule("netkey");
+PRLogModuleInfo *nkeyLogMS = PR_NewLogModule("coolKeyMessage");
void URLEncode(unsigned char *buf,char *ret, int *ret_len,int buff_len);
void URLDecode(char *buf,unsigned char *ret, int *ret_len,int buff_len);
Index: NSSManager.cpp
===================================================================
RCS file: /cvs/dirsec/esc/src/lib/coolkey/NSSManager.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- NSSManager.cpp 12 Jun 2006 23:39:51 -0000 1.1.1.1
+++ NSSManager.cpp 27 Sep 2006 17:47:46 -0000 1.2
@@ -15,6 +15,8 @@
* All rights reserved.
* END COPYRIGHT BLOCK **/
+#define FORCE_PR_LOG 1
+
#include "NSSManager.h"
#include "SmartCardMonitoringThread.h"
@@ -31,14 +33,19 @@
#include "p12plcy.h"
#include "secmod.h"
#include "secerr.h"
+#include "secder.h"
#include "certdb.h"
#include "secmodt.h"
#include "keythi.h"
#include "keyhi.h"
+#include
+ #include
+
+
#include "SlotUtils.h"
-static PRLogModuleInfo *coolKeyLogNSS = PR_NewLogModule("coolKey");
+static PRLogModuleInfo *coolKeyLogNSS = PR_NewLogModule("coolKeyNSS");
NSSManager::NSSManager()
{
@@ -59,6 +66,9 @@
{
// Init NSS
+ PR_LOG( coolKeyLogNSS, PR_LOG_ALWAYS, ("Initializing the NSS Crypto Library. \n"));
+
+
if(aAppDir)
{
SECStatus status = NSS_Init(aAppDir);
@@ -85,7 +95,7 @@
char modSpec[512];
- sprintf(modSpec,"library='%s' name='%s' parameters='%s'\n",COOLKEY_PKCS11_LIBRARY,COOLKEY_NAME,PROMISCUOUS_PARAMETER);
+ sprintf(modSpec,"library=\"%s\" name=\"%s\" parameters=\"%s\" NSS=\"slotParams={0x00000002=[slotFlags='PublicCerts']}\"\n",COOLKEY_PKCS11_LIBRARY,COOLKEY_NAME,PROMISCUOUS_PARAMETER);
PR_LOG( coolKeyLogNSS, PR_LOG_DEBUG, ("InitNSS: modSpec %s\n",modSpec));
@@ -96,7 +106,7 @@
if(!userModule || !userModule->loaded)
{
- PR_LOG( coolKeyLogNSS, PR_LOG_DEBUG, ("NSSManager::InitNSS problem loading PKCS11 module. \n"));
+ PR_LOG( coolKeyLogNSS, PR_LOG_ALWAYS, ("NSSManager::InitNSS problem loading PKCS11 module. No keys will be recognized!\n"));
return E_FAIL;
}
@@ -122,13 +132,6 @@
// Logout all tokens.
PK11_LogoutAll();
-
- //No longer Shutdown NSS, we are using the PSM XPCOM service which
- // takes care of this
-
- // SECStatus rv = NSS_Shutdown();
-
- PR_LOG( coolKeyLogNSS, PR_LOG_DEBUG, ("NSSManager::Shutdown \n"));
}
bool
@@ -246,13 +249,11 @@
PR_LOG( coolKeyLogNSS, PR_LOG_DEBUG, ("NSSManager::GetKeyCertNickNames \n"));
-
if(!aKey )
{
return E_FAIL;
}
-
PK11SlotInfo *slot = GetSlotForKeyID(aKey);
if (!slot)
@@ -260,7 +261,33 @@
return E_FAIL;
}
- CERTCertList *certs = PK11_ListCertsInSlot(slot);
+ CERTCertList *certs = PK11_ListCerts(PK11CertListAll,NULL);
+
+ if (!certs)
+ {
+ PR_LOG( coolKeyLogNSS, PR_LOG_DEBUG, ("NSSManager::GetCertNicknames no certs found! \n"));
+ PK11_FreeSlot(slot);
+ return E_FAIL;
+ }
+ CERTCertListNode *node= NULL;
+ for( node = CERT_LIST_HEAD(certs);
+ ! CERT_LIST_END(node, certs);
+ node = CERT_LIST_NEXT(node))
+ {
+ if(node->cert)
+ {
+ CERTCertificate *cert = node->cert;
+ if(cert)
+ {
+ if(cert->slot != slot)
+ {
+ CERT_RemoveCertListNode(node);
+ }
+ }
+ }
+
+ }
+
if (!certs)
{
@@ -306,10 +333,91 @@
}
+HRESULT NSSManager::GetKeyIssuedTo(const CoolKey *aKey, char *aBuf, int aBufLength)
+{
+
+ if(!aBuf)
+ return E_FAIL;
+
+ aBuf[0]=0;
+
+ PR_LOG( coolKeyLogNSS, PR_LOG_DEBUG, ("NSSManager::GetKeyIssuedTo \n"));
+
+ if(!aKey )
+ {
+ return E_FAIL;
+ }
+
+ PK11SlotInfo *slot = GetSlotForKeyID(aKey);
+
+ if (!slot)
+ {
+ return E_FAIL;
+ }
+
+
+ CERTCertList *certs = PK11_ListCerts(PK11CertListAll,NULL);
+
+ if (!certs)
+ {
+ PR_LOG( coolKeyLogNSS, PR_LOG_DEBUG, ("NSSManager::GetKeyIssuedTo no certs found! \n"));
+ PK11_FreeSlot(slot);
+ return E_FAIL;
+ }
+
+ CERTCertListNode *node= NULL;
+
+ char *certID = NULL;
+
+
+ for( node = CERT_LIST_HEAD(certs);
+ ! CERT_LIST_END(node, certs);
+ node = CERT_LIST_NEXT(node))
+ {
+ if(node->cert)
+ {
+ CERTCertificate *cert = node->cert;
+
+ if(cert)
+ {
+
+
+ if(cert->slot == slot)
+ {
+
+ certID = CERT_GetCommonName(&cert->subject);
+ PR_LOG( coolKeyLogNSS, PR_LOG_DEBUG, ("NSSManager::GetKeyIssuedTo ourSlot %p curSlot %p certID %s \n",slot,cert->slot,certID));
+
+ }
+
+ if(certID)
+ break;
+ }
+ }
+
+ }
+
+ if(certID && ((int)strlen(certID) < aBufLength))
+ {
+ strcpy(aBuf,certID);
+ }
+
+ if(certs)
+ CERT_DestroyCertList(certs);
+
+ if(slot)
+ PK11_FreeSlot(slot);
+
+ if(certID)
+ PORT_Free(certID);
+
+ return S_OK;
+}
+
HRESULT NSSManager::GetKeyCertInfo(const CoolKey *aKey, char *aCertNickname, string & aCertInfo)
{
- PR_LOG( coolKeyLogNSS, PR_LOG_DEBUG, ("NSSManager::GetKeyCertInfo \n"));
+ PR_LOG( coolKeyLogNSS, PR_LOG_DEBUG, ("NSSManager::GetKeyCertInfo Nickname %s \n",aCertNickname));
aCertInfo = "";
@@ -330,7 +438,7 @@
return E_FAIL;
}
- CERTCertList *certs = PK11_ListCertsInSlot(slot);
+ CERTCertList *certs = PK11_ListCerts(PK11CertListAll,NULL);
if (!certs)
{
@@ -339,19 +447,75 @@
return E_FAIL;
}
- CERTCertListNode *node= CERT_LIST_HEAD(certs);
+ PR_LOG(coolKeyLogNSS, PR_LOG_DEBUG, ("NSSManager::GetKeyCertInfo About to get CertList for slot. \n"));
- if(!CERT_LIST_END(node,certs))
- {
- CERTCertificate *cert = CERT_FindCertByNickname(node->cert->dbhandle,aCertNickname);
-
- if(cert)
+ CERTCertListNode *node= NULL;
+ for( node = CERT_LIST_HEAD(certs);
+ ! CERT_LIST_END(node, certs);
+ node = CERT_LIST_NEXT(node))
{
- aCertInfo = (char *) "";
- }
- }
+ if(node->cert)
+ {
+ CERTCertificate *cert = node->cert;
+ if(cert)
+ {
+ if(cert->slot == slot)
+ {
+ if(!strcmp(cert->nickname,aCertNickname))
+ {
+ PR_LOG(coolKeyLogNSS, PR_LOG_DEBUG, ("NSSManager::GetKeyCertInfo We have a matching cert to our slot. nickname %s \n",cert->nickname));
+
+ char *issuerCN = NULL;
+ char *issuedToCN = NULL;
+
+ aCertInfo = (char *) "";
+ issuedToCN = cert->subjectName;
+ issuerCN = cert->issuerName;
+
+ string issuerCNStr = "";
+ if(issuerCN)
+ issuerCNStr = issuerCN;
+
+ string issuedToCNStr = "" ;
+ if(issuedToCN)
+ issuedToCNStr = issuedToCN;
+
+ string notBeforeStr = "";
+ string notAfterStr = "";
+
+ char *nBefore = (char *) DER_UTCTimeToAscii(&cert->validity.notBefore);
+ char *nAfter = (char *) DER_UTCTimeToAscii(&cert->validity.notAfter);
+
+
+
+ if(nBefore)
+ notBeforeStr = nBefore;
+ if(nAfter)
+ notAfterStr = nAfter;
+
+ PR_LOG( coolKeyLogNSS, PR_LOG_DEBUG, ("NSSManager::GetKeyCertInfo notBefore %s notAfter %s \n",nBefore, nAfter));
+
+
+ int serialNumber = DER_GetInteger(&cert->serialNumber);
+
+ std::ostringstream o;
+ string serialStr = "";
+ if (o << serialNumber)
+ serialStr = o.str();
+
+ aCertInfo = issuedToCNStr + "\n" + issuerCNStr + "\n"
+ + notBeforeStr + "\n" + notAfterStr + "\n" + serialStr ;
+ PR_LOG( coolKeyLogNSS, PR_LOG_DEBUG, ("NSSManager::GetKeyCertInfo issuerCN %s issuedToCN %s \n",issuerCN, issuedToCN));
+
+
+ break;
+ }
+ }
+ }
+ }
+ }
- PR_LOG( coolKeyLogNSS, PR_LOG_DEBUG, ("NSSManager::GetKeyCertINfo info %s \n",aCertInfo.c_str()));
+ PR_LOG( coolKeyLogNSS, PR_LOG_DEBUG, ("NSSManager::GetKeyCertInfo info: %s \n",aCertInfo.c_str()));
if(certs)
CERT_DestroyCertList(certs);
@@ -361,6 +525,7 @@
return S_OK;
}
+
HRESULT
NSSManager::GetKeyPolicy(const CoolKey *aKey, char *aBuf, int aBufLength)
{
@@ -404,6 +569,7 @@
if (aBufLength - policyLen - 1 >=0) {
// if this policy ID isn't in the buffer, add it.
+
if (!strstr(aBuf, policyID)) {
// assuming that this isn't the start, add our delimiter
Index: NSSManager.h
===================================================================
RCS file: /cvs/dirsec/esc/src/lib/coolkey/NSSManager.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- NSSManager.h 12 Jun 2006 23:39:52 -0000 1.1.1.1
+++ NSSManager.h 27 Sep 2006 17:47:46 -0000 1.2
@@ -23,7 +23,9 @@
#define COOLKEY_NAME "COOL Key Module"
#define MUSCLE_NAME "SLB PKCS #11 module"
-#define PROMISCUOUS_PARAMETER "promiscuous=yes"
+#define PROMISCUOUS_PARAMETER "noAppletOK=yes"
+#define NSS_PUBLIC_CERTS "slotFlags=PublicCerts"
+
#ifndef NSSMANAGER_H
#define NSSMANAGER_H
@@ -64,6 +66,8 @@
static HRESULT GetKeyCertNicknames( const CoolKey *aKey, vector & aStrings );
+ static HRESULT GetKeyIssuedTo(const CoolKey *aKey, char *aBuf, int aBufLength);
+
Index: SlotUtils.cpp
===================================================================
RCS file: /cvs/dirsec/esc/src/lib/coolkey/SlotUtils.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- SlotUtils.cpp 12 Jun 2006 23:39:52 -0000 1.1.1.1
+++ SlotUtils.cpp 27 Sep 2006 17:47:46 -0000 1.2
@@ -15,6 +15,8 @@
* All rights reserved.
* END COPYRIGHT BLOCK **/
+#define FORCE_PR_LOG 1
+
#include "nss.h"
#include "secmod.h"
#include "pk11func.h"
@@ -42,7 +44,7 @@
static std::list gCoolKeyList;
PRLock *gCoolKeyListLock = NULL;
-static PRLogModuleInfo *coolKeyLogSU = PR_NewLogModule("coolKey");
+static PRLogModuleInfo *coolKeyLogSU = PR_NewLogModule("coolKeySlot");
#ifdef DEBUG
int gCoolKeyListLockCount = 0;
#endif // DEBUG
@@ -315,6 +317,10 @@
CoolKeyInfo *info = GetCoolKeyInfoByKeyIDInternal(aKey);
+ int alreadyCoolKey = 0;
+ if( IS_REALLY_A_COOLKEY(info->mInfoFlags))
+ alreadyCoolKey = 1;
+
if (!info)
return -1;
@@ -323,6 +329,11 @@
info->mInfoFlags = CKHGetInfoFlags(info->mSlot);
+ if(alreadyCoolKey)
+ {
+ info->mInfoFlags |= COOLKEY_INFO_IS_REALLY_A_COOLKEY_MASK;
+ }
+
return 0;
}
Index: SlotUtils.h
===================================================================
RCS file: /cvs/dirsec/esc/src/lib/coolkey/SlotUtils.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- SlotUtils.h 12 Jun 2006 23:39:52 -0000 1.1.1.1
+++ SlotUtils.h 27 Sep 2006 17:47:46 -0000 1.2
@@ -38,10 +38,12 @@
#define COOLKEY_INFO_HAS_ATR_MASK (1 << 0)
#define COOLKEY_INFO_HAS_APPLET_MASK (1 << 1)
#define COOLKEY_INFO_IS_PERSONALIZED_MASK (1 << 2)
+#define COOLKEY_INFO_IS_REALLY_A_COOLKEY_MASK (1 << 3)
#define HAS_ATR(info) ((info)&COOLKEY_INFO_HAS_ATR_MASK)
#define HAS_APPLET(info) ((info)&COOLKEY_INFO_HAS_APPLET_MASK)
#define IS_PERSONALIZED(info) ((info)&COOLKEY_INFO_IS_PERSONALIZED_MASK)
+#define IS_REALLY_A_COOLKEY(info) ((info)&COOLKEY_INFO_IS_REALLY_A_COOLKEY_MASK)
struct CoolKeyInfo
{
Index: SmartCardMonitoringThread.cpp
===================================================================
RCS file: /cvs/dirsec/esc/src/lib/coolkey/SmartCardMonitoringThread.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- SmartCardMonitoringThread.cpp 12 Jun 2006 23:39:52 -0000 1.1.1.1
+++ SmartCardMonitoringThread.cpp 27 Sep 2006 17:47:46 -0000 1.2
@@ -15,13 +15,7 @@
* All rights reserved.
* END COPYRIGHT BLOCK **/
-//#include "XptlBase.h"
-//#include "CoolBucky.h"
-//#include "CoolSec.h"
-//#include "CoolBos.h"
-//#include "ILocateManager.h"
-//#include "ICertificateBlob.h"
-//#include "atlbase.h"
+#define FORCE_PR_LOG 1
#include "nspr.h"
@@ -32,14 +26,10 @@
#include "NSSManager.h"
#include "CoolKeyID.h"
#include "SlotUtils.h"
-//#include "CoolKeyThreadEventService.h"
-
#include
-static PRLogModuleInfo *coolKeyLogSC = PR_NewLogModule("coolKey");
-
-//WINOLEAPI CoInitializeEx(IN LPVOID pvReserved, IN DWORD dwCoInit);
+static PRLogModuleInfo *coolKeyLogSC = PR_NewLogModule("coolKeySmart");
SmartCardMonitoringThread::SmartCardMonitoringThread(SECMODModule *aModule)
: mModule(aModule), mThread(NULL)
@@ -79,7 +69,7 @@
{
PR_LOG( coolKeyLogSC, PR_LOG_DEBUG,
- ("SmartCardMonitoringThread::Insert pig: \n"));
+ ("SmartCardMonitoringThread::Insert Key. \n"));
CoolKeyInfo *info = CKHGetCoolKeyInfo(aSlot);
if (info) {
@@ -95,7 +85,7 @@
void SmartCardMonitoringThread::Remove(CoolKeyInfo *info)
{
PR_LOG( coolKeyLogSC, PR_LOG_DEBUG,
- ("SmartCardMonitoringThread::Remove : \n"));
+ ("SmartCardMonitoringThread::Remove Key: \n"));
info->mInfoFlags = 0;
AutoCoolKey key(eCKType_CoolKey, info->mCUID);
@@ -136,9 +126,8 @@
slot = SECMOD_WaitForAnyTokenEvent(mModule, 0, PR_SecondsToInterval(1) );
- PR_LOG( coolKeyLogSC, PR_LOG_DEBUG,
- ("SmartCardMonitoringThread::Execute Token Event fired :"
- " slot %p \n", slot));
+ PR_LOG( coolKeyLogSC, PR_LOG_ALWAYS,
+ ("SmartCard thread event detected. \n"));
if (slot == NULL) {
Index: ckymanager.def
===================================================================
RCS file: /cvs/dirsec/esc/src/lib/coolkey/ckymanager.def,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- ckymanager.def 12 Jun 2006 23:39:52 -0000 1.1.1.1
+++ ckymanager.def 27 Sep 2006 17:47:46 -0000 1.2
@@ -56,10 +56,6 @@
CoolKeySetDataValue;
CoolKeyGetTokenName;
CoolKeyGetKeyID;
-CoolKeyGetPref;
-CoolKeyFreePref;
-CoolKeyPrefInit;
-CoolKeyPrefShutdown;
;+ local:
;+ *;
;+};
Index: manifest.mn
===================================================================
RCS file: /cvs/dirsec/esc/src/lib/coolkey/manifest.mn,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- manifest.mn 12 Jun 2006 23:39:51 -0000 1.1.1.1
+++ manifest.mn 27 Sep 2006 17:47:46 -0000 1.2
@@ -17,10 +17,14 @@
CORE_DEPTH = ../../..
+SYS_INC = /usr/include
MODULE = ckymanager
LIBRARY_NAME = $(MODULE)
REQUIRES = httpchunked nss nspr ckyapplet
-DEFINES += -I$(CORE_DEPTH)/esc/app/xpcom
+ifndef MOZ_OFFSET
+MOZ_OFFSET = mozilla-1.7.13
+endif
+DEFINES += -I$(CORE_DEPTH)/esc/app/xpcom -I$(SYS_INC)/nspr4 -I$(SYS_INC)/nss3 -I$(SYS_INC)/PCSC -I$(SYS_INC)/$(MOZ_OFFSET)/nspr -I$(SYS_INC)/$(MOZ_OFFSET)/nss
MAPFILE = $(OBJDIR)/ckymanager.def
#EXTRA_LIBS += -L$(DIST)/lib -lckyapplet
@@ -31,12 +35,10 @@
CoolKey_Message.cpp \
CoolKeyHandler.cpp \
CoolKey.cpp \
- CoolKeyPref.cpp \
SmartCardMonitoringThread.cpp \
$(NULL)
EXPORTS = \
CoolKey.h \
- CoolKeyPref.h \
$(NULL)
From fedora-directory-commits at redhat.com Wed Sep 27 17:48:31 2006
From: fedora-directory-commits at redhat.com (Jack Magne (jmagne))
Date: Wed, 27 Sep 2006 10:48:31 -0700
Subject: [Fedora-directory-commits] esc/src/lib/notifytray notifyareaicon.c,
1.1, 1.2 notifytray.c, 1.1, 1.2
Message-ID: <200609271748.k8RHmV9f027454@cvs-int.fedora.redhat.com>
Author: jmagne
Update of /cvs/dirsec/esc/src/lib/notifytray
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv27433
Modified Files:
notifyareaicon.c notifytray.c
Log Message:
Latest updates.
Index: notifyareaicon.c
===================================================================
RCS file: /cvs/dirsec/esc/src/lib/notifytray/notifyareaicon.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- notifyareaicon.c 13 Sep 2006 18:06:08 -0000 1.1
+++ notifyareaicon.c 27 Sep 2006 17:48:29 -0000 1.2
@@ -16,6 +16,7 @@
* END COPYRIGHT BLOCK **/
#include
+#include
#include
#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 ();
Index: notifytray.c
===================================================================
RCS file: /cvs/dirsec/esc/src/lib/notifytray/notifytray.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- notifytray.c 13 Sep 2006 18:06:08 -0000 1.1
+++ notifytray.c 27 Sep 2006 17:48:29 -0000 1.2
@@ -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()
From fedora-directory-commits at redhat.com Wed Sep 27 17:49:24 2006
From: fedora-directory-commits at redhat.com (Jack Magne (jmagne))
Date: Wed, 27 Sep 2006 10:49:24 -0700
Subject: [Fedora-directory-commits] esc/src/lib/NssHttpClient
HttpClientNss.h, 1.1.1.1, 1.2 Iterator.h, 1.1.1.1,
1.2 NssHttpClient.cpp, 1.1.1.1, 1.2 engine.cpp, 1.1.1.1,
1.2 http.cpp, 1.1.1.1, 1.2 http.h, 1.1.1.1,
1.2 httpClientNss.cpp, 1.1.1.1, 1.2 manifest.mn, 1.1.1.1,
1.2 request.cpp, 1.1.1.1, 1.2 response.cpp, 1.1.1.1, 1.2
Message-ID: <200609271749.k8RHnOm9027506@cvs-int.fedora.redhat.com>
Author: jmagne
Update of /cvs/dirsec/esc/src/lib/NssHttpClient
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv27475
Modified Files:
HttpClientNss.h Iterator.h NssHttpClient.cpp engine.cpp
http.cpp http.h httpClientNss.cpp manifest.mn request.cpp
response.cpp
Log Message:
Latest updates.
Index: HttpClientNss.h
===================================================================
RCS file: /cvs/dirsec/esc/src/lib/NssHttpClient/HttpClientNss.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- HttpClientNss.h 12 Jun 2006 23:39:52 -0000 1.1.1.1
+++ HttpClientNss.h 27 Sep 2006 17:49:21 -0000 1.2
@@ -33,8 +33,6 @@
PSHttpRequest * _request;
PSHttpResponse* _response;
-
- PSHttpResponse *httpSend(char *host_port, char *uri, char *method, char *body);
PSHttpResponse *httpSendChunked(char *host_port, char *uri, char *method, char *body,PSChunkedResponseCallback cb,void *uw,PRBool doSSL = PR_FALSE,int messageTimeout =30);
PRBool sendChunkedEntityData(int body_len,unsigned char * body);
Index: Iterator.h
===================================================================
RCS file: /cvs/dirsec/esc/src/lib/NssHttpClient/Iterator.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- Iterator.h 12 Jun 2006 23:39:53 -0000 1.1.1.1
+++ Iterator.h 27 Sep 2006 17:49:21 -0000 1.2
@@ -39,6 +39,9 @@
* @return The next element, if any, or NULL
*/
virtual void *Next() = 0;
+
+ virtual ~Iterator(){};
+
};
#endif // _ITERATOR_H_
Index: NssHttpClient.cpp
===================================================================
RCS file: /cvs/dirsec/esc/src/lib/NssHttpClient/NssHttpClient.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- NssHttpClient.cpp 12 Jun 2006 23:39:52 -0000 1.1.1.1
+++ NssHttpClient.cpp 27 Sep 2006 17:49:21 -0000 1.2
@@ -69,9 +69,8 @@
{
PRBool result = InitSecurity(NULL, NULL, NULL, NULL,1 );
- if(result = PR_FALSE)
+ if(result == PR_FALSE)
{
-
return 0;
}
Index: engine.cpp
===================================================================
RCS file: /cvs/dirsec/esc/src/lib/NssHttpClient/engine.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- engine.cpp 12 Jun 2006 23:39:53 -0000 1.1.1.1
+++ engine.cpp 27 Sep 2006 17:49:21 -0000 1.2
@@ -27,7 +27,6 @@
#include "certt.h"
#include "sslerr.h"
#include "secerr.h"
-#include "secutil.h"
#include "engine.h"
#include "http.h"
@@ -42,18 +41,6 @@
PRIntervalTime Engine::globaltimeout = PR_TicksPerSecond()*30;
-static char * ownPasswd( PK11SlotInfo *slot, PRBool retry, void *arg) {
- if (!retry) {
- if( password != NULL ) {
- return PL_strdup(password);
- } else {
- return PL_strdup( "httptest" );
- }
- } else {
- return NULL;
- }
-}
-
/**
* Function: SECStatus myBadCertHandler()
*
@@ -248,9 +235,6 @@
}
}
- PRErrorCode error = PR_GetError();
-
-
/* If this is a server, we're finished. */
if (isServer || secStatus != SECSuccess) {
return secStatus;
Index: http.cpp
===================================================================
RCS file: /cvs/dirsec/esc/src/lib/NssHttpClient/http.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- http.cpp 12 Jun 2006 23:39:53 -0000 1.1.1.1
+++ http.cpp 27 Sep 2006 17:49:21 -0000 1.2
@@ -144,6 +144,8 @@
return "HTTP/1.1";
case HTTPBOGUS:
return "BOGO-PROTO";
+ default:
+ break;
}
return NULL;
Index: http.h
===================================================================
RCS file: /cvs/dirsec/esc/src/lib/NssHttpClient/http.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- http.h 12 Jun 2006 23:39:53 -0000 1.1.1.1
+++ http.h 27 Sep 2006 17:49:21 -0000 1.2
@@ -43,7 +43,6 @@
typedef bool ( *PSChunkedResponseCallback)(unsigned char *entity_data,unsigned entity_data_len,void *uw, int status);
class PSHttpResponse;
-extern PSHttpResponse *httpSend(char *host_port, char *uri, char *method, char *body);
PSHttpResponse *httpSendChunked(char *host_port, char *uri, char *method, char *body,PSChunkedResponseCallback cb,void *uw);
Index: httpClientNss.cpp
===================================================================
RCS file: /cvs/dirsec/esc/src/lib/NssHttpClient/httpClientNss.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- httpClientNss.cpp 12 Jun 2006 23:39:53 -0000 1.1.1.1
+++ httpClientNss.cpp 27 Sep 2006 17:49:21 -0000 1.2
@@ -53,45 +53,6 @@
}
/*
- * httpSend: sends to an HTTP server
- * Standard Http, may not work in this version.
- */
-PSHttpResponse *HttpClientNss::httpSend(char *host_port, char *uri, char *method, char *body)
-{
- const char* nickname = NULL;
-
- int timeout = 30;
-
- PSHttpServer server(host_port, PR_AF_INET);
- server.setSSL(PR_TRUE);
- // use "HTTP10" if no chunking
- PSHttpRequest request( &server, uri, HTTP11, 0 );
-
-
- _request = &request;
- request.setSSL(PR_FALSE);
-
- request.setMethod(method);
- if (body != NULL)
- request.setBody( (int)strlen(body), body);
-
- // use with "POST" only
- request.addHeader( "Content-Type", "text/xml" );
- request.addHeader( "Connection", "keep-alive" );
- HttpEngine engine;
- PSHttpResponse *resp = engine.makeRequest( request, server, 30 /*_timeout*/ , PR_FALSE /* expect chunked*/);
-
- _response = resp;
-
- if(resp->getStatus() != 200)
- {
- return NULL;
-
- }
- return resp;
-}
-
-/*
Send a http message with a persistant transfer chunked encoded message type
*/
@@ -147,17 +108,14 @@
}
void HttpClientNss::CloseConnection()
{
-
if(_engine)
{
_engine->CloseConnection();
-
}
}
PRBool HttpClientNss::sendChunkedEntityData(int body_len,unsigned char *body)
{
-
int timeout = PR_TicksPerSecond()*60;
char chunked_message[4096];
@@ -171,7 +129,6 @@
return PR_FALSE;
}
-
HttpEngine *engine= getEngine();
if(!engine)
Index: manifest.mn
===================================================================
RCS file: /cvs/dirsec/esc/src/lib/NssHttpClient/manifest.mn,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- manifest.mn 12 Jun 2006 23:39:52 -0000 1.1.1.1
+++ manifest.mn 27 Sep 2006 17:49:21 -0000 1.2
@@ -17,11 +17,16 @@
CORE_DEPTH = ../../..
+SYS_INC = /usr/include
MODULE = httpchunked
LIBRARY_NAME = $(MODULE)
SHARED_NAME = $(MODULE)
REQUIRES = nss nspr
+ifndef MOZ_OFFSET
+MOZ_OFFSET = mozilla-1.7.13
+endif
MAPFILE = $(OBJDIR)/httpchunked.def
+DEFINES = -I$(SYS_INC)/nspr4 -I$(SYS_INC)/nss3 -I$(SYS_INC)/$(MOZ_OFFSET)/nspr -I$(SYS_INC)/$(MOZ_OFFSET)/nss
CPPSRCS = \
Cache.cpp \
Index: request.cpp
===================================================================
RCS file: /cvs/dirsec/esc/src/lib/NssHttpClient/request.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- request.cpp 12 Jun 2006 23:39:53 -0000 1.1.1.1
+++ request.cpp 27 Sep 2006 17:49:21 -0000 1.2
@@ -17,13 +17,15 @@
* All rights reserved.
* END COPYRIGHT BLOCK **/
+#define FORCE_PR_LOG 1
+
#include
#include
#include "request.h"
#include "engine.h"
#include
-PRLogModuleInfo *httpLog = PR_NewLogModule("coolkey");
+PRLogModuleInfo *httpLog = PR_NewLogModule("coolKeyHttpReq");
/**
* Constructor
Index: response.cpp
===================================================================
RCS file: /cvs/dirsec/esc/src/lib/NssHttpClient/response.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- response.cpp 12 Jun 2006 23:39:52 -0000 1.1.1.1
+++ response.cpp 27 Sep 2006 17:49:21 -0000 1.2
@@ -16,6 +16,8 @@
* All rights reserved.
* END COPYRIGHT BLOCK **/
+#define FORCE_PR_LOG 1
+
/**
* HTTP response handler
*/
@@ -35,10 +37,8 @@
#endif
#include "Util.h"
-PRLogModuleInfo *httpRespLog = PR_NewLogModule("coolkey");
+PRLogModuleInfo *httpRespLog = PR_NewLogModule("coolKeyHttpRes");
-void printBuf(int , char* );
-void dump_data(unsigned char *aData, int aLen);
/**
* Constructor. This class is used by the HttpResponse class for reading and
@@ -174,16 +174,12 @@
if(!_streamMode )
{
- _content = (char *) PR_Malloc(_curSize+1);
- if (_content == NULL) {
- return PR_FALSE;
+ _content = (char *) PR_Malloc(_curSize+1);
+ if (_content == NULL)
+ return PR_FALSE;
- memcpy((char*) _content, (const char *)_buf, _curSize+1);
- _contentSize = _curSize +1;
-
- }
-
- //dump_data(( unsigned char *) _content,_contentSize);
+ memcpy((char*) _content, (const char *)_buf, _curSize+1);
+ _contentSize = _curSize +1;
}
@@ -229,9 +225,6 @@
return 0;
}
-void printBuf(int len, char* buf) {
-}
-
/**
* gets the next char from the buffer. If all the data in the buffer is read,
* read a chunk to the buffer
@@ -240,11 +233,7 @@
char RecvBuf::_getChar() {
if (_curPos >= _curSize) {
if (!_getBytes(_allocSize)) {
- /* bugscape #55624: Solaris RA exited
- with a signal ABRT if we raised exception
- without handling it */
return -1;
- /* throw RecvBuf::EndOfFile(); */
}
}
@@ -281,7 +270,7 @@
if (ch != '\r' || ch2 != '\n')
{
PR_LOG(httpRespLog, PR_LOG_DEBUG,
- ("did not find chunk trailer at end of chunk 1. \n"));
+ ("did not find chunk trailer at end of chunk . \n"));
}
}
@@ -316,7 +305,7 @@
if (ch1 != '\r' || ch2 != '\n')
{
PR_LOG(httpRespLog, PR_LOG_DEBUG,
- ("did not find chunk trailer at the end of chunk 2. ch1 %c ch2 %c \n",ch1,ch2));
+ ("did not find chunk trailer at the end of chunk . ch1 %c ch2 %c \n",ch1,ch2));
};
_currentChunkSize = _currentChunkBytesRead = 0;
@@ -681,8 +670,6 @@
char chunk[4096];
- int len = sizeof(chunk);
-
int i = 0;
PSChunkedResponseCallback cb = _request->getChunkedCallback();
@@ -743,7 +730,6 @@
PR_LOG(httpRespLog, PR_LOG_DEBUG,
("PSHttpResponse::_handleChunkedConversation"
" chunk complete normal condition. chunk: %s\n",(char *) chunk));
- //dump_data((unsigned char *)chunk,i);
(*cb)((unsigned char *) chunk,i,uw,HTTP_CHUNK_COMPLETE);
}
@@ -779,7 +765,7 @@
if(cb != NULL)
{// We need to process the chunked encoded conversation
- PRBool res = _handleChunkedConversation(buf);
+ _handleChunkedConversation(buf);
}
} else {
@@ -1062,27 +1048,3 @@
}
}
}
-
-
-void dump_data(unsigned char *aData, int aLen) {
-
- if(!aData || !aLen)
- return;
-
-
- for(int i = 0; i < aLen ; i++)
- {
-
-
-
- PR_LOG(httpRespLog, PR_LOG_DEBUG,
- ("dumpdata at %d: %c \n", i, aData[i]
- ));
-
-
- }
-
-
-
-
-}
From fedora-directory-commits at redhat.com Wed Sep 27 17:50:27 2006
From: fedora-directory-commits at redhat.com (Jack Magne (jmagne))
Date: Wed, 27 Sep 2006 10:50:27 -0700
Subject: [Fedora-directory-commits] esc/src Makefile,1.2,1.3
Message-ID: <200609271750.k8RHoRt6027548@cvs-int.fedora.redhat.com>
Author: jmagne
Update of /cvs/dirsec/esc/src
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv27531
Modified Files:
Makefile
Log Message:
Latest updates.
Index: Makefile
===================================================================
RCS file: /cvs/dirsec/esc/src/Makefile,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Makefile 13 Sep 2006 17:46:53 -0000 1.2
+++ Makefile 27 Sep 2006 17:50:24 -0000 1.3
@@ -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
From fedora-directory-commits at redhat.com Wed Sep 27 17:52:56 2006
From: fedora-directory-commits at redhat.com (Jack Magne (jmagne))
Date: Wed, 27 Sep 2006 10:52:56 -0700
Subject: [Fedora-directory-commits] esc/src/app/xul/esc/chrome/content/esc
MineOverlay.xul, NONE, 1.1 certManager.xul, NONE, 1.1
Message-ID: <200609271752.k8RHqu7q027603@cvs-int.fedora.redhat.com>
Author: jmagne
Update of /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv27586
Added Files:
MineOverlay.xul certManager.xul
Log Message:
Initial revision.
--- NEW FILE MineOverlay.xul ---
&certmgr.mine;
--- NEW FILE certManager.xul ---
From fedora-directory-commits at redhat.com Wed Sep 27 23:40:59 2006
From: fedora-directory-commits at redhat.com (Noriko Hosoi (nhosoi))
Date: Wed, 27 Sep 2006 16:40:59 -0700
Subject: [Fedora-directory-commits] ldapserver/ldap/servers/slapd/tools
pwenc.c, 1.6, 1.7
Message-ID: <200609272340.k8RNexgG016599@cvs-int.fedora.redhat.com>
Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/servers/slapd/tools
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv16463/ldap/servers/slapd/tools
Modified Files:
pwenc.c
Log Message:
[207427] parameterizing the hardcoded paths (Comment #15)
phase 1. parameterizing config, schema and ldif directory
Index: pwenc.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/tools/pwenc.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- pwenc.c 11 Apr 2006 02:14:51 -0000 1.6
+++ pwenc.c 27 Sep 2006 23:40:52 -0000 1.7
@@ -82,7 +82,7 @@
usage( name )
char *name;
{
- fprintf( stderr, "usage: %s -D instance-dir [-H] [-s scheme | -c comparepwd ] password...\n", name );
+ fprintf( stderr, "usage: %s -D config-dir [-H] [-s scheme | -c comparepwd ] password...\n", name );
exit( 1 );
}
@@ -133,7 +133,7 @@
slapdFrontendConfig_t *slapdFrontendConfig = NULL;
char *opts = "Hs:c:D:";
- char *instancedir = NULL;
+ char *configdir = NULL;
name = argv[ 0 ];
pwsp = cmppwsp = NULL;
@@ -157,13 +157,13 @@
/* kexcoff: quite the same as slapd_bootstrap_config */
FrontendConfig_init();
- instancedir = rel2abspath( optarg );
- if ( config_set_instancedir( "configdir (-D)", instancedir,
+ configdir = rel2abspath( optarg );
+ if ( config_set_configdir( "configdir (-D)", configdir,
errorbuf, 1) != LDAP_SUCCESS ) {
fprintf( stderr, "%s\n", errorbuf );
return( 1 );
}
- slapi_ch_free((void **)&instancedir);
+ slapi_ch_free((void **)&configdir);
slapdFrontendConfig = getFrontendConfig();
From fedora-directory-commits at redhat.com Wed Sep 27 23:40:46 2006
From: fedora-directory-commits at redhat.com (Noriko Hosoi (nhosoi))
Date: Wed, 27 Sep 2006 16:40:46 -0700
Subject: [Fedora-directory-commits] ldapserver/ldap/admin/include dsalib.h,
1.5, 1.6
Message-ID: <200609272341.k8RNfGvw016602@cvs-int.fedora.redhat.com>
Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/admin/include
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv16463/ldap/admin/include
Modified Files:
dsalib.h
Log Message:
[207427] parameterizing the hardcoded paths (Comment #15)
phase 1. parameterizing config, schema and ldif directory
Index: dsalib.h
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/admin/include/dsalib.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- dsalib.h 19 Apr 2005 22:06:53 -0000 1.5
+++ dsalib.h 27 Sep 2006 23:40:43 -0000 1.6
@@ -318,6 +318,10 @@
extern DS_EXPORT_SYMBOL int ds_get_bemonitor(char *bemdn, char *port);
extern DS_EXPORT_SYMBOL int ds_client_access(char *port, char *dn);
extern DS_EXPORT_SYMBOL char **ds_get_config(int type);
+extern DS_EXPORT_SYMBOL char *ds_get_config_dir();
+extern DS_EXPORT_SYMBOL void ds_set_config_dir(char *config_dir);
+extern DS_EXPORT_SYMBOL char *ds_get_run_dir();
+extern DS_EXPORT_SYMBOL void ds_set_run_dir(char *run_dir);
extern DS_EXPORT_SYMBOL char *ds_get_pwenc(char *passwd_hash, char *password);
extern DS_EXPORT_SYMBOL int ds_check_config(int type);
extern DS_EXPORT_SYMBOL int ds_check_pw(char *pwhash, char *pwclear);
From fedora-directory-commits at redhat.com Wed Sep 27 23:40:52 2006
From: fedora-directory-commits at redhat.com (Noriko Hosoi (nhosoi))
Date: Wed, 27 Sep 2006 16:40:52 -0700
Subject: [Fedora-directory-commits] ldapserver/ldap/admin/lib dsalib_conf.c,
1.5, 1.6 dsalib_location.c, 1.6, 1.7 dsalib_updown.c, 1.6, 1.7
Message-ID: <200609272341.k8RNfMYo016607@cvs-int.fedora.redhat.com>
Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/admin/lib
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv16463/ldap/admin/lib
Modified Files:
dsalib_conf.c dsalib_location.c dsalib_updown.c
Log Message:
[207427] parameterizing the hardcoded paths (Comment #15)
phase 1. parameterizing config, schema and ldif directory
Index: dsalib_conf.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/admin/lib/dsalib_conf.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- dsalib_conf.c 19 Apr 2005 22:06:54 -0000 1.5
+++ dsalib_conf.c 27 Sep 2006 23:40:44 -0000 1.6
@@ -51,7 +51,7 @@
#include "nspr.h"
-#define CONF_FILE_NAME "config/dse.ldif"
+#define CONF_FILE_NAME "dse.ldif"
#define CONF_SUFFIX "cn=config"
DS_EXPORT_SYMBOL char *
@@ -69,7 +69,7 @@
ds_get_config(int type)
{
char conffile[PATH_MAX];
- char *root;
+ char *configdir;
FILE *sf = NULL;
char **conf_list = NULL;
@@ -78,12 +78,12 @@
return(NULL);
}
- if ( (root = ds_get_install_root()) == NULL ) {
- ds_send_error("Cannot find server root directory.", 0);
+ if ( (configdir = ds_get_config_dir()) == NULL ) {
+ ds_send_error("Cannot find configuration directory.", 0);
return(NULL);
}
- PR_snprintf(conffile, PATH_MAX, "%s/%s", root, CONF_FILE_NAME);
+ PR_snprintf(conffile, PATH_MAX, "%s/%s", configdir, CONF_FILE_NAME);
if ( !(sf = fopen(conffile, "r")) ) {
ds_send_error("could not read config file.", 1);
Index: dsalib_location.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/admin/lib/dsalib_location.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- dsalib_location.c 19 Apr 2005 22:06:54 -0000 1.6
+++ dsalib_location.c 27 Sep 2006 23:40:44 -0000 1.7
@@ -58,11 +58,11 @@
if ( (root = getenv("NETSITE_ROOT")) == NULL )
return(NULL);
- /* WIN32: Needed to take care of embedded space, */
- /* otherwise system() call fails */
- root = ds_makeshort( root );
+ /* WIN32: Needed to take care of embedded space, */
+ /* otherwise system() call fails */
+ root = ds_makeshort( root );
- return root;
+ return root;
}
/*
@@ -87,6 +87,52 @@
}
/*
+ * Returns the config file location of the server. Info is
+ * returned in a static area. The caller must copy it
+ * for reuse if needed.
+ */
+DS_EXPORT_SYMBOL char *
+ds_get_config_dir()
+{
+ return getenv("DS_CONFIG_DIR");
+}
+
+/*
+ * set config_dir to environment variable DS_CONFIG_DIR
+ * to retrieve the value using ds_get_config_dir later.
+ */
+DS_EXPORT_SYMBOL void
+ds_set_config_dir(char *config_dir)
+{
+ static char env[PATH_MAX];
+ PR_snprintf(env, sizeof(env), "DS_CONFIG_DIR=%s", config_dir);
+ putenv(env);
+}
+
+/*
+ * Returns the run dir of the server, where pid files are put.
+ * Info is returned in a static area. The caller must copy it
+ * for reuse if needed.
+ */
+DS_EXPORT_SYMBOL char *
+ds_get_run_dir()
+{
+ return getenv("DS_RUN_DIR");
+}
+
+/*
+ * set run_dir to environment variable DS_RUN_DIR
+ * to retrieve the value using ds_get_run_dir later.
+ */
+DS_EXPORT_SYMBOL void
+ds_set_run_dir(char *run_dir)
+{
+ static char env[PATH_MAX];
+ PR_snprintf(env, sizeof(env), "DS_RUN_DIR=%s", run_dir);
+ putenv(env);
+}
+
+/*
* Returns the install location of the server under the admserv
* directory.
*/
@@ -109,50 +155,50 @@
ds_get_server_name()
{
if( getenv("SERVER_NAMES") )
- return( getenv("SERVER_NAMES") );
- else {
- static char logfile[PATH_MAX];
- char *buf;
- char *out = logfile;
- buf = getenv("SCRIPT_NAME");
- if ( buf && (*buf == '/') )
- buf++;
- while ( *buf && (*buf != '/') ) {
- *out++ = *buf++;
- }
- *out = 0;
- return logfile;
- }
+ return( getenv("SERVER_NAMES") );
+ else {
+ static char logfile[PATH_MAX];
+ char *buf;
+ char *out = logfile;
+ buf = getenv("SCRIPT_NAME");
+ if ( buf && (*buf == '/') )
+ buf++;
+ while ( *buf && (*buf != '/') ) {
+ *out++ = *buf++;
+ }
+ *out = 0;
+ return logfile;
+ }
}
DS_EXPORT_SYMBOL char *
ds_get_logfile_name(int config_type)
{
char *filename;
- char **ds_config = NULL;
+ char **ds_config = NULL;
static char logfile[PATH_MAX+1];
if ( (ds_config = ds_get_config(DS_REAL_CONFIG)) == NULL ) {
- /* For DS 4.0, no error output if file doesn't exist - that's
- a normal situation */
- /* ds_send_error("ds_get_config(DS_REAL_CONFIG) == NULL", 0); */
+ /* For DS 4.0, no error output if file doesn't exist - that's
+ a normal situation */
+ /* ds_send_error("ds_get_config(DS_REAL_CONFIG) == NULL", 0); */
return(NULL);
}
filename = ds_get_value(ds_config, ds_get_var_name(config_type), 0, 1);
if ( filename == NULL ) {
- /* For DS 4.0, no error output if file doesn't exist - that's
- a normal situation */
- /* ds_send_error("ds_get_logfile_name: filename == NULL", 0); */
+ /* For DS 4.0, no error output if file doesn't exist - that's
+ a normal situation */
+ /* ds_send_error("ds_get_logfile_name: filename == NULL", 0); */
return(NULL);
}
if ( ((int) strlen(filename)) >= PATH_MAX ) {
- ds_send_error("ds_get_logfile_name: filename too long", 0);
- free(filename);
+ ds_send_error("ds_get_logfile_name: filename too long", 0);
+ free(filename);
return(NULL);
}
PL_strncpyz(logfile, filename, sizeof(logfile));
- free(filename);
+ free(filename);
return(logfile);
}
Index: dsalib_updown.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/admin/lib/dsalib_updown.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- dsalib_updown.c 19 Apr 2005 22:06:54 -0000 1.6
+++ dsalib_updown.c 27 Sep 2006 23:40:44 -0000 1.7
@@ -80,44 +80,44 @@
DS_EXPORT_SYMBOL int
ds_get_updown_status()
{
- char pid_file_name[BIG_LINE];
- char *root;
- FILE *pidfile;
- int ipid = -1;
- int status = 0;
+ char pid_file_name[BIG_LINE];
+ char *rundir;
+ FILE *pidfile;
+ int ipid = -1;
+ int status = 0;
- if ( (root = ds_get_install_root()) == NULL ) {
- fprintf(stderr, "ds_get_updown_status: could not get install root\n");
+ if ( (rundir = ds_get_run_dir()) == NULL ) {
+ fprintf(stderr, "ds_get_updown_status: could not get install root\n");
return(DS_SERVER_UNKNOWN);
- }
- PR_snprintf(pid_file_name, BIG_LINE, "%s/logs/pid", root);
+ }
+ PR_snprintf(pid_file_name, BIG_LINE, "%s/pid", rundir);
pidfile = fopen(pid_file_name, "r");
if ( pidfile == NULL ) {
-/*
- fprintf(stderr,
- "ds_get_updown_status: could not open pid file=%s errno=%d\n",
- pid_file_name, errno);
+/*
+ fprintf(stderr,
+ "ds_get_updown_status: could not open pid file=%s errno=%d\n",
+ pid_file_name, errno);
*/
return(DS_SERVER_DOWN);
- }
- status = fscanf(pidfile, "%d\n", &ipid);
- fclose(pidfile);
+ }
+ status = fscanf(pidfile, "%d\n", &ipid);
+ fclose(pidfile);
if ( status == -1 ) {
- fprintf(stderr,
- "ds_get_updown_status: pidfile=%s server_pid=%d errno=%d\n",
- pid_file_name, ipid, errno);
+ fprintf(stderr,
+ "ds_get_updown_status: pidfile=%s server_pid=%d errno=%d\n",
+ pid_file_name, ipid, errno);
unlink(pid_file_name); /* junk in file? */
return(DS_SERVER_DOWN);
}
server_pid = (pid_t) ipid;
if ( (status = kill(server_pid, 0)) != 0 && errno != EPERM ) {
- /* we should get ESRCH if the server is down, anything else may be
- a real problem */
- if (errno != ESRCH) {
- fprintf(stderr,
- "ds_get_updown_status: pidfile=%s server_pid=%d status=%d errno=%d\n",
- pid_file_name, server_pid, status, errno);
- }
+ /* we should get ESRCH if the server is down, anything else may be
+ a real problem */
+ if (errno != ESRCH) {
+ fprintf(stderr,
+ "ds_get_updown_status: pidfile=%s server_pid=%d status=%d errno=%d\n",
+ pid_file_name, server_pid, status, errno);
+ }
unlink(pid_file_name); /* pid does not exist! */
return(DS_SERVER_DOWN);
}
@@ -127,12 +127,12 @@
DS_EXPORT_SYMBOL int
ds_get_updown_status()
{
- char *ds_name = ds_get_server_name();
+ char *ds_name = ds_get_server_name();
HANDLE hServerDoneEvent = NULL;
/* watchdog.c creates a global event of this same name */
if((hServerDoneEvent = OpenEvent(EVENT_ALL_ACCESS, TRUE, ds_name)) != NULL)
- {
+ {
CloseHandle(hServerDoneEvent);
return(DS_SERVER_UP);
}
@@ -154,17 +154,17 @@
ds_bring_up_server_install(int verbose, char *root, char *errorlog)
{
#if !defined( XP_WIN32 )
- char startup_line[BIG_LINE];
- char statfile[PATH_MAX];
- char *tmp_dir;
+ char startup_line[BIG_LINE];
+ char statfile[PATH_MAX];
+ char *tmp_dir;
#endif
int error = -1;
- int status = DS_SERVER_DOWN;
- int cur_size = 0;
- FILE *sf = NULL;
- char msgBuf[BIG_LINE] = {0};
- int secondsToWaitForServer = 600;
- char *serverStartupString = "slapd started.";
+ int status = DS_SERVER_DOWN;
+ int cur_size = 0;
+ FILE *sf = NULL;
+ char msgBuf[BIG_LINE] = {0};
+ int secondsToWaitForServer = 600;
+ char *serverStartupString = "slapd started.";
status = ds_get_updown_status();
if ( status == DS_SERVER_UP )
@@ -173,116 +173,116 @@
return(DS_SERVER_UNKNOWN);
if (verbose) {
- ds_send_status("starting up server ...");
- cur_size = ds_get_file_size(errorlog);
- }
+ ds_send_status("starting up server ...");
+ cur_size = ds_get_file_size(errorlog);
+ }
#if !defined( XP_WIN32 )
tmp_dir = ds_get_tmp_dir();
PR_snprintf(statfile, PATH_MAX, "%s%cstartup.%d", tmp_dir, FILE_SEP, (int)getpid());
PR_snprintf(startup_line, BIG_LINE, "%s%c%s > %s 2>&1",
- root, FILE_SEP, START_SCRIPT, statfile);
+ root, FILE_SEP, START_SCRIPT, statfile);
alter_startup_line(startup_line);
error = system(startup_line);
if (error == -1)
- error = DS_SERVER_DOWN; /* could not start server */
+ error = DS_SERVER_DOWN; /* could not start server */
else
- error = DS_SERVER_UP; /* started server */
+ error = DS_SERVER_UP; /* started server */
#else
error = StartServer();
#endif
- if (error != DS_SERVER_UP)
- {
+ if (error != DS_SERVER_UP)
+ {
#if !defined( XP_WIN32 )
- FILE* fp = fopen(statfile, "r");
- if (fp)
- {
- while(fgets(msgBuf, BIG_LINE, fp))
- ds_send_status(msgBuf);
- fclose(fp);
- }
+ FILE* fp = fopen(statfile, "r");
+ if (fp)
+ {
+ while(fgets(msgBuf, BIG_LINE, fp))
+ ds_send_status(msgBuf);
+ fclose(fp);
+ }
#endif
- return DS_SERVER_COULD_NOT_START;
- }
+ return DS_SERVER_COULD_NOT_START;
+ }
if (verbose)
{
- /*
- * Stop in N secs or whenever the startup message comes up.
- * Do whichever happens first. msgBuf will contain the last
- * line read from the errorlog.
- */
- ds_display_tail(errorlog, secondsToWaitForServer, cur_size,
- serverStartupString, msgBuf);
+ /*
+ * Stop in N secs or whenever the startup message comes up.
+ * Do whichever happens first. msgBuf will contain the last
+ * line read from the errorlog.
+ */
+ ds_display_tail(errorlog, secondsToWaitForServer, cur_size,
+ serverStartupString, msgBuf);
}
if ( error != DS_SERVER_UP ) {
- int retval = DS_SERVER_UNKNOWN;
- if (strstr(msgBuf, "semget"))
- retval = DS_SERVER_MAX_SEMAPHORES;
- else if (strstr(msgBuf, "Back-End Initialization Failed"))
- retval = DS_SERVER_CORRUPTED_DB;
- else if (strstr(msgBuf, "not initialized... exiting"))
- retval = DS_SERVER_CORRUPTED_DB;
- else if (strstr(msgBuf, "address is in use"))
- retval = DS_SERVER_PORT_IN_USE;
+ int retval = DS_SERVER_UNKNOWN;
+ if (strstr(msgBuf, "semget"))
+ retval = DS_SERVER_MAX_SEMAPHORES;
+ else if (strstr(msgBuf, "Back-End Initialization Failed"))
+ retval = DS_SERVER_CORRUPTED_DB;
+ else if (strstr(msgBuf, "not initialized... exiting"))
+ retval = DS_SERVER_CORRUPTED_DB;
+ else if (strstr(msgBuf, "address is in use"))
+ retval = DS_SERVER_PORT_IN_USE;
#if defined( XP_WIN32 )
- /* on NT, if we run out of resources, there will not even be an error
- log
- */
- else if (msgBuf[0] == 0) {
- retval = DS_SERVER_NO_RESOURCES;
- }
-#endif
- if (verbose)
- ds_send_error("error in starting server.", 1);
- return(retval);
+ /* on NT, if we run out of resources, there will not even be an error
+ log
+ */
+ else if (msgBuf[0] == 0) {
+ retval = DS_SERVER_NO_RESOURCES;
+ }
+#endif
+ if (verbose)
+ ds_send_error("error in starting server.", 1);
+ return(retval);
}
if (verbose) {
#if !defined( XP_WIN32 )
- if( !(sf = fopen(statfile, "r")) ) {
- ds_send_error("could not read status file.", 1);
- return(DS_SERVER_UNKNOWN);
- }
-
- while ( fgets(startup_line, BIG_LINE, sf) )
- ds_send_error(startup_line, 0);
- fclose(sf);
- unlink(statfile);
-#endif
- status = DS_SERVER_UNKNOWN;
- if (strstr(msgBuf, "semget"))
- status = DS_SERVER_MAX_SEMAPHORES;
- else if (strstr(msgBuf, "Back-End Initialization Failed"))
- status = DS_SERVER_CORRUPTED_DB;
- else if (strstr(msgBuf, "not initialized... exiting"))
- status = DS_SERVER_CORRUPTED_DB;
- else if (strstr(msgBuf, "address is in use"))
- status = DS_SERVER_PORT_IN_USE;
+ if( !(sf = fopen(statfile, "r")) ) {
+ ds_send_error("could not read status file.", 1);
+ return(DS_SERVER_UNKNOWN);
+ }
+
+ while ( fgets(startup_line, BIG_LINE, sf) )
+ ds_send_error(startup_line, 0);
+ fclose(sf);
+ unlink(statfile);
+#endif
+ status = DS_SERVER_UNKNOWN;
+ if (strstr(msgBuf, "semget"))
+ status = DS_SERVER_MAX_SEMAPHORES;
+ else if (strstr(msgBuf, "Back-End Initialization Failed"))
+ status = DS_SERVER_CORRUPTED_DB;
+ else if (strstr(msgBuf, "not initialized... exiting"))
+ status = DS_SERVER_CORRUPTED_DB;
+ else if (strstr(msgBuf, "address is in use"))
+ status = DS_SERVER_PORT_IN_USE;
#if defined( XP_WIN32 )
- /* on NT, if we run out of resources, there will not even be an error
- log
- */
- else if (msgBuf[0] == 0) {
- status = DS_SERVER_NO_RESOURCES;
- }
+ /* on NT, if we run out of resources, there will not even be an error
+ log
+ */
+ else if (msgBuf[0] == 0) {
+ status = DS_SERVER_NO_RESOURCES;
+ }
#endif
} else {
- int tries;
- for (tries = 0; tries < secondsToWaitForServer; tries++) {
- if (ds_get_updown_status() == DS_SERVER_UP) break;
- PR_Sleep(PR_SecondsToInterval(1));
- }
- if (verbose) {
- char str[100];
- PR_snprintf(str, sizeof(str), "Had to retry %d times", tries);
- ds_send_status(str);
- }
+ int tries;
+ for (tries = 0; tries < secondsToWaitForServer; tries++) {
+ if (ds_get_updown_status() == DS_SERVER_UP) break;
+ PR_Sleep(PR_SecondsToInterval(1));
+ }
+ if (verbose) {
+ char str[100];
+ PR_snprintf(str, sizeof(str), "Had to retry %d times", tries);
+ ds_send_status(str);
+ }
}
if ( (status == DS_SERVER_DOWN) || (status == DS_SERVER_UNKNOWN) )
- status = ds_get_updown_status();
+ status = ds_get_updown_status();
return(status);
}
@@ -300,8 +300,8 @@
ds_bring_up_server(int verbose)
{
char *root;
- int status;
- char *errorlog;
+ int status;
+ char *errorlog;
status = ds_get_updown_status();
if ( status == DS_SERVER_UP )
return(DS_SERVER_ALREADY_UP);
@@ -310,66 +310,66 @@
errorlog = ds_get_config_value(DS_ERRORLOG);
if ( errorlog == NULL ) {
- errorlog = ds_get_errors_name(); /* fallback */
+ errorlog = ds_get_errors_name(); /* fallback */
}
- return ds_bring_up_server_install(verbose, root, errorlog);
+ return ds_bring_up_server_install(verbose, root, errorlog);
}
DS_EXPORT_SYMBOL int
ds_bring_down_server()
{
char *root;
- int status;
- int cur_size;
+ int status;
+ int cur_size;
char *errorlog;
- status = ds_get_updown_status(); /* set server_pid too! */
+ status = ds_get_updown_status(); /* set server_pid too! */
if ( status != DS_SERVER_UP ) {
- ds_send_error("The server is not up.", 0);
+ ds_send_error("The server is not up.", 0);
return(DS_SERVER_ALREADY_DOWN);
}
if ( (root = ds_get_install_root()) == NULL ) {
- ds_send_error("Could not get the server root directory.", 0);
+ ds_send_error("Could not get the server root directory.", 0);
return(DS_SERVER_UNKNOWN);
}
ds_send_status("shutting down server ...");
if (!(errorlog = ds_get_errors_name())) {
- ds_send_error("Could not get the error log filename.", 0);
- return DS_SERVER_UNKNOWN;
+ ds_send_error("Could not get the error log filename.", 0);
+ return DS_SERVER_UNKNOWN;
}
cur_size = ds_get_file_size(errorlog);
#if !defined( XP_WIN32 )
if ( (kill(server_pid, SIGTERM)) != 0) {
- if (errno == EPERM) {
- ds_send_error("Not permitted to kill server.", 0);
- fprintf (stdout, "[%s]: kill (%li, SIGTERM) failed with errno = EPERM. \n",
- ds_get_server_name(), (long)server_pid);
- } else {
- ds_send_error("error in killing server.", 1);
- }
+ if (errno == EPERM) {
+ ds_send_error("Not permitted to kill server.", 0);
+ fprintf (stdout, "[%s]: kill (%li, SIGTERM) failed with errno = EPERM. \n",
+ ds_get_server_name(), (long)server_pid);
+ } else {
+ ds_send_error("error in killing server.", 1);
+ }
return(DS_SERVER_UNKNOWN);
}
#else
if( StopServer() == DS_SERVER_DOWN )
- {
- ds_send_status("shutdown: server shut down");
- }
- else
- {
+ {
+ ds_send_status("shutdown: server shut down");
+ }
+ else
+ {
ds_send_error("error in killing server.", 1);
return(DS_SERVER_UNKNOWN);
- }
+ }
#endif
/*
* Wait up to SERVER_STOP_TIMEOUT seconds for the stopped message to
- * appear in the error log.
+ * appear in the error log.
*/
ds_display_tail(errorlog, SERVER_STOP_TIMEOUT, cur_size, "slapd stopped.", NULL);
/* in some cases, the server will tell us it's down when it's really not,
so give the OS a chance to remove it from the process table */
- PR_Sleep(PR_SecondsToInterval(1));
+ PR_Sleep(PR_SecondsToInterval(1));
return(ds_get_updown_status());
}
@@ -379,32 +379,32 @@
IsService()
{
#if 0
- CHAR ServerKey[512], *ValueString;
- HKEY hServerKey;
- DWORD dwType, ValueLength, Result;
-
- PR_snprintf(ServerKey,sizeof(ServerKey), "%s\\%s", COMPANY_KEY, PRODUCT_KEY);
-
- Result = RegOpenKey(HKEY_LOCAL_MACHINE, ServerKey, &hServerKey);
- if (Result != ERROR_SUCCESS) {
- return TRUE;
- }
- ValueLength = 512;
- ValueString = (PCHAR)malloc(ValueLength);
-
- Result = RegQueryValueEx(hServerKey, IS_SERVICE_KEY, NULL,
- &dwType, ValueString, &ValueLength);
- if (Result != ERROR_SUCCESS) {
- return TRUE;
- }
- if (strcmp(ValueString, "yes")) {
- return FALSE;
- }
- else {
- return TRUE;
- }
+ CHAR ServerKey[512], *ValueString;
+ HKEY hServerKey;
+ DWORD dwType, ValueLength, Result;
+
+ PR_snprintf(ServerKey,sizeof(ServerKey), "%s\\%s", COMPANY_KEY, PRODUCT_KEY);
+
+ Result = RegOpenKey(HKEY_LOCAL_MACHINE, ServerKey, &hServerKey);
+ if (Result != ERROR_SUCCESS) {
+ return TRUE;
+ }
+ ValueLength = 512;
+ ValueString = (PCHAR)malloc(ValueLength);
+
+ Result = RegQueryValueEx(hServerKey, IS_SERVICE_KEY, NULL,
+ &dwType, ValueString, &ValueLength);
+ if (Result != ERROR_SUCCESS) {
+ return TRUE;
+ }
+ if (strcmp(ValueString, "yes")) {
+ return FALSE;
+ }
+ else {
+ return TRUE;
+ }
#else
- return TRUE;
+ return TRUE;
#endif
}
@@ -412,29 +412,29 @@
NSAPI_PUBLIC BOOLEAN
IsAdminService()
{
- CHAR AdminKey[512], *ValueString;
- HKEY hAdminKey;
- DWORD dwType, ValueLength, Result;
-
- PR_snprintf(AdminKey,sizeof(AdminKey), "%s\\%s", COMPANY_KEY, ADMIN_REGISTRY_ROOT_KEY);
-
- Result = RegOpenKey(HKEY_LOCAL_MACHINE, AdminKey, &hAdminKey);
- if (Result != ERROR_SUCCESS) {
- return TRUE;
- }
- ValueLength = 512;
- ValueString = (PCHAR)malloc(ValueLength);
-
- Result = RegQueryValueEx(hAdminKey, IS_SERVICE_KEY, NULL,
- &dwType, ValueString, &ValueLength);
- if (Result != ERROR_SUCCESS) {
- return TRUE;
- }
- if (strcmp(ValueString, "yes")) {
- return FALSE;
- } else {
- return TRUE;
- }
+ CHAR AdminKey[512], *ValueString;
+ HKEY hAdminKey;
+ DWORD dwType, ValueLength, Result;
+
+ PR_snprintf(AdminKey,sizeof(AdminKey), "%s\\%s", COMPANY_KEY, ADMIN_REGISTRY_ROOT_KEY);
+
+ Result = RegOpenKey(HKEY_LOCAL_MACHINE, AdminKey, &hAdminKey);
+ if (Result != ERROR_SUCCESS) {
+ return TRUE;
+ }
+ ValueLength = 512;
+ ValueString = (PCHAR)malloc(ValueLength);
+
+ Result = RegQueryValueEx(hAdminKey, IS_SERVICE_KEY, NULL,
+ &dwType, ValueString, &ValueLength);
+ if (Result != ERROR_SUCCESS) {
+ return TRUE;
+ }
+ if (strcmp(ValueString, "yes")) {
+ return FALSE;
+ } else {
+ return TRUE;
+ }
}
#endif
@@ -453,7 +453,7 @@
NULL, // database (NULL == default)
SC_MANAGER_ALL_ACCESS // access required
))) {
- PR_snprintf(ErrorString, sizeof(ErrorString),
+ PR_snprintf(ErrorString, sizeof(ErrorString),
"Error: Could not open the ServiceControlManager:%d "
"Please restart the server %s from the Services Program Item "
"in the Control Panel", ds_get_server_name(), GetLastError());
@@ -519,7 +519,7 @@
"Error: Could not open the ServiceControlManager:%d "
"Please restart the server %s from the Services Program Item "
"in the Control Panel", ds_get_server_name(), GetLastError());
- ds_send_error(ErrorString, 0);
+ ds_send_error(ErrorString, 0);
return(DS_SERVER_UNKNOWN);
}
return(StopNetscapeService());
@@ -534,9 +534,9 @@
char line[BIG_LINE], cmd[BIG_LINE];
char *tmp = ds_get_install_root();
- CHAR ErrorString[512];
- STARTUPINFO siStartInfo;
- PROCESS_INFORMATION piProcInfo;
+ CHAR ErrorString[512];
+ STARTUPINFO siStartInfo;
+ PROCESS_INFORMATION piProcInfo;
FILE *CmdFile;
ZeroMemory(line, sizeof(line));
@@ -545,7 +545,7 @@
CmdFile = fopen(line, "r");
if (!CmdFile)
- {
+ {
PR_snprintf(ErrorString, sizeof(ErrorString), "Error:Tried to start server %s "
": Could not open the startup script %s :Error %d. Please "
"run startsrv.bat from the server's root directory.",
@@ -556,7 +556,7 @@
ZeroMemory(cmd, sizeof(cmd));
if (!fread(cmd, 1, BIG_LINE, CmdFile))
- {
+ {
PR_snprintf(ErrorString, sizeof(ErrorString), "Error:Tried to start server %s "
": Could not read the startup script %s :Error %d. Please "
"run startsrv.bat from the server's root directory.",
@@ -565,25 +565,25 @@
return(DS_SERVER_DOWN);
}
- ZeroMemory(&siStartInfo, sizeof(STARTUPINFO));
- siStartInfo.cb = sizeof(STARTUPINFO);
- siStartInfo.lpReserved = siStartInfo.lpReserved2 = NULL;
- siStartInfo.cbReserved2 = 0;
- siStartInfo.lpDesktop = NULL;
-
- if (!CreateProcess(NULL, cmd, NULL, NULL, FALSE,
- 0, NULL, NULL, &siStartInfo, &piProcInfo))
- {
+ ZeroMemory(&siStartInfo, sizeof(STARTUPINFO));
+ siStartInfo.cb = sizeof(STARTUPINFO);
+ siStartInfo.lpReserved = siStartInfo.lpReserved2 = NULL;
+ siStartInfo.cbReserved2 = 0;
+ siStartInfo.lpDesktop = NULL;
+
+ if (!CreateProcess(NULL, cmd, NULL, NULL, FALSE,
+ 0, NULL, NULL, &siStartInfo, &piProcInfo))
+ {
PR_snprintf(ErrorString, sizeof(ErrorString), "Error:Tried to start server %s "
": Could not start up the startup script %s :Error %d. Please "
"run startsrv.bat from the server's root directory.",
ds_get_server_name(), line, GetLastError());
ds_send_error(ErrorString, 0);
return(DS_SERVER_DOWN);
- }
+ }
- CloseHandle(piProcInfo.hProcess);
- CloseHandle(piProcInfo.hThread);
+ CloseHandle(piProcInfo.hProcess);
+ CloseHandle(piProcInfo.hThread);
return(DS_SERVER_UP);
}
@@ -596,7 +596,7 @@
hEvent = CreateEvent(NULL, TRUE, FALSE, servid);
if(!SetEvent(hEvent))
- {
+ {
PR_snprintf(ErrorString, sizeof(ErrorString), "Tried to stop existing server %s"
": Could not signal it to stop :Error %d",
servid, GetLastError());
@@ -619,7 +619,7 @@
schService = OpenService(schSCManager, serviceName, SERVICE_ALL_ACCESS);
if (schService == NULL)
- {
+ {
PR_snprintf(ErrorString, sizeof(ErrorString), "Tried to open service"
" %s: Error %d (%s). Please"
" stop the server from the Services Item in the Control Panel",
@@ -644,7 +644,7 @@
return(DS_SERVER_DOWN);
}
else if (Error != ERROR_SERVICE_NOT_ACTIVE)
- {
+ {
PR_snprintf(ErrorString, sizeof(ErrorString), "Tried to stop service"
" %s: Error %d (%s)."
" Please stop the server from the Services Item in the"
@@ -668,7 +668,7 @@
serviceName, // name of service
SERVICE_ALL_ACCESS);
if (schService == NULL)
- {
+ {
CloseServiceHandle(schService);
PR_snprintf(ErrorString, sizeof(ErrorString),"Tried to start"
" the service %s: Error %d. Please"
@@ -679,7 +679,7 @@
}
if (!StartService(schService, 0, NULL))
- {
+ {
CloseServiceHandle(schService);
PR_snprintf(ErrorString, sizeof(ErrorString), "StartService:Could not start "
"the Directory service %s: Error %d. Please restart the server "
@@ -703,7 +703,7 @@
RETRY:
- newServiceName = PR_smprintf("NS_%s", serviceName);
+ newServiceName = PR_smprintf("NS_%s", serviceName);
hServDoneSemaphore = CreateSemaphore(
NULL, // security attributes
From fedora-directory-commits at redhat.com Wed Sep 27 23:40:53 2006
From: fedora-directory-commits at redhat.com (Noriko Hosoi (nhosoi))
Date: Wed, 27 Sep 2006 16:40:53 -0700
Subject: [Fedora-directory-commits] ldapserver/ldap/cm Makefile,1.61,1.62
Message-ID: <200609272341.k8RNfNQk016618@cvs-int.fedora.redhat.com>
Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/cm
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv16463/ldap/cm
Modified Files:
Makefile
Log Message:
[207427] parameterizing the hardcoded paths (Comment #15)
phase 1. parameterizing config, schema and ldif directory
Index: Makefile
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/cm/Makefile,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -r1.61 -r1.62
--- Makefile 15 Sep 2006 19:33:42 -0000 1.61
+++ Makefile 27 Sep 2006 23:40:50 -0000 1.62
@@ -310,7 +310,7 @@
$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/schema/*.ldif $(RELDIR)/bin/slapd/install/schema
$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/schema/slapd-collations.conf $(RELDIR)/bin/slapd/install/config
- $(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/lib/ldaputil/certmap.conf $(RELDIR)/shared/config
+ $(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/lib/ldaputil/certmap.conf $(RELDIR)/bin/slapd/install/config
# the httpd library
ifneq ($(ARCH), WINNT)
From fedora-directory-commits at redhat.com Wed Sep 27 23:40:53 2006
From: fedora-directory-commits at redhat.com (Noriko Hosoi (nhosoi))
Date: Wed, 27 Sep 2006 16:40:53 -0700
Subject: [Fedora-directory-commits]
ldapserver/ldap/servers/slapd auth.c, 1.6,
1.7 config.c, 1.6, 1.7 dse.c, 1.5, 1.6 fedse.c, 1.7,
1.8 libglobs.c, 1.9, 1.10 main.c, 1.11, 1.12 proto-slap.h,
1.20, 1.21 schema.c, 1.8, 1.9 slap.h, 1.14, 1.15
Message-ID: <200609272341.k8RNfNbm016623@cvs-int.fedora.redhat.com>
Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/servers/slapd
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv16463/ldap/servers/slapd
Modified Files:
auth.c config.c dse.c fedse.c libglobs.c main.c proto-slap.h
schema.c slap.h
Log Message:
[207427] parameterizing the hardcoded paths (Comment #15)
phase 1. parameterizing config, schema and ldif directory
Index: auth.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/auth.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- auth.c 11 Apr 2006 02:14:44 -0000 1.6
+++ auth.c 27 Sep 2006 23:40:51 -0000 1.7
@@ -272,41 +272,27 @@
client_auth_init ()
{
char *instancedir;
- int len = 0;
- char *val = NULL;
- char* filename;
- char netsite_root[MAXPATHLEN];
int err;
if (client_auth_config_file == NULL) {
- client_auth_config_file = "shared/config/certmap.conf";
- }
-
- /* calculate the server_root from instance dir */
- instancedir = config_get_instancedir();
- /* make sure path does not end in the path separator character */
- len = strlen(instancedir);
- if (instancedir[len-1] == '/' || instancedir[len-1] == '\\') {
- instancedir[len-1] = '\0';
- }
-
- /* get the server root from the path */
- val = strrchr(instancedir, '/');
- if (!val) {
- val = strrchr(instancedir, '\\');
+ char *confdir = config_get_configdir();
+ if (NULL == confdir) {
+ LDAPDebug (LDAP_DEBUG_ANY,
+ "client_auth_init: failed to get configdir\n",
+ 0, 0, 0);
+ return;
+ }
+ client_auth_config_file = PR_smprintf("%s/certmap.conf", confdir);
+ if (NULL == client_auth_config_file) {
+ LDAPDebug (LDAP_DEBUG_ANY,
+ "client_auth_init: failed to duplicate \"%s/certmap\"\n",
+ confdir, 0, 0);
+ return;
+ }
}
- if (val) {
- val++;
- *val = '\0';
- }
-
- PL_strncpyz(netsite_root, instancedir, MAXPATHLEN);
- slapi_ch_free_string(&instancedir);
- filename = PR_smprintf("%s%s", netsite_root, client_auth_config_file);
-
- err = ldaputil_init (filename, "", netsite_root, "slapd", NULL);
+ err = ldaputil_init (client_auth_config_file, "", NULL, "slapd", NULL);
if (err != LDAPU_SUCCESS) {
LDAPDebug (LDAP_DEBUG_TRACE, "ldaputil_init(%s,...) %i\n",
- filename, err, 0);
+ client_auth_config_file, err, 0);
} else {
LDAPUVTable_t vtable = {
NULL /* ssl_init */,
@@ -329,9 +315,6 @@
slapu_value_free_len};
ldapu_VTable_set (&vtable);
}
- PR_smprintf_free (filename);
- /* why do we define these strings if we never use them? */
- if (ldapu_strings != NULL);
/* Generate a component id for cert-based authentication */
generate_id();
Index: config.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/config.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- config.c 24 Nov 2005 01:39:44 -0000 1.6
+++ config.c 27 Sep 2006 23:40:51 -0000 1.7
@@ -160,30 +160,40 @@
char *buf = 0;
char *lastp = 0;
char *entrystr = 0;
+ char *instancedir = NULL;
+ if (NULL == configdir) {
+ slapi_log_error(SLAPI_LOG_FATAL,
+ "startup", "Passed null config directory\n");
+ return rc; /* Fail */
+ }
PR_snprintf(configfile, sizeof(configfile), "%s/%s", configdir,
- CONFIG_FILENAME);
+ CONFIG_FILENAME);
if ( (rc = PR_GetFileInfo( configfile, &prfinfo )) != PR_SUCCESS )
{
/* the "real" file does not exist; see if there is a tmpfile */
char tmpfile[MAXPATHLEN+1];
+ slapi_log_error(SLAPI_LOG_FATAL, "config",
+ "The configuration file %s does not exist\n", configfile);
PR_snprintf(tmpfile, sizeof(tmpfile), "%s/%s.tmp", configdir,
- CONFIG_FILENAME);
+ CONFIG_FILENAME);
if ( PR_GetFileInfo( tmpfile, &prfinfo ) == PR_SUCCESS ) {
rc = PR_Rename(tmpfile, configfile);
if (rc == PR_SUCCESS) {
slapi_log_error(SLAPI_LOG_FATAL, "config",
"The configuration file %s was restored from backup %s\n",
configfile, tmpfile);
- rc = 1;
} else {
slapi_log_error(SLAPI_LOG_FATAL, "config",
"The configuration file %s was not restored from backup %s, error %d\n",
configfile, tmpfile, rc);
- rc = 0;
+ return rc; /* Fail */
}
} else {
- rc = 0; /* fail */
+ slapi_log_error(SLAPI_LOG_FATAL, "config",
+ "The backup configuration file %s does not exist, either.\n",
+ tmpfile);
+ return rc; /* Fail */
}
}
if ( (rc = PR_GetFileInfo( configfile, &prfinfo )) != PR_SUCCESS )
@@ -191,7 +201,7 @@
PRErrorCode prerr = PR_GetError();
slapi_log_error(SLAPI_LOG_FATAL, "config", "The given config file %s could not be accessed, " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n",
configfile, prerr, slapd_pr_strerror(prerr));
- rc = 0; /* Fail */
+ return rc;
}
else if (( prfd = PR_Open( configfile, PR_RDONLY,
SLAPD_DEFAULT_FILE_MODE )) == NULL )
@@ -199,7 +209,7 @@
PRErrorCode prerr = PR_GetError();
slapi_log_error(SLAPI_LOG_FATAL, "config", "The given config file %s could not be opened for reading, " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n",
configfile, prerr, slapd_pr_strerror(prerr));
- rc = 0; /* Fail */
+ return rc; /* Fail */
}
else
{
@@ -218,7 +228,7 @@
if(!done)
{
- char errorlog[MAXPATHLEN+1];
+ char workpath[MAXPATHLEN+1];
char loglevel[BUFSIZ];
char maxdescriptors[BUFSIZ];
char val[BUFSIZ];
@@ -227,7 +237,7 @@
char schemacheck[BUFSIZ];
Slapi_DN plug_dn;
- errorlog[0] = loglevel[0] = maxdescriptors[0] = '\0';
+ workpath[0] = loglevel[0] = maxdescriptors[0] = '\0';
val[0] = logenabled[0] = schemacheck[0] = '\0';
_localuser[0] = '\0';
@@ -252,6 +262,28 @@
continue;
}
+ /* if instancedir is not set, set it first */
+ {
+ instancedir = config_get_instancedir();
+ if (NULL == instancedir) {
+ workpath[0] = '\0';
+ if (entry_has_attr_and_value(e,
+ CONFIG_INSTANCEDIR_ATTRIBUTE,
+ workpath, sizeof(workpath))) {
+ if (config_set_instancedir(
+ CONFIG_INSTANCEDIR_ATTRIBUTE,
+ workpath, errorbuf, CONFIG_APPLY)
+ != LDAP_SUCCESS) {
+ LDAPDebug(LDAP_DEBUG_ANY, "%s: %s: %s\n",
+ configfile, CONFIG_INSTANCEDIR_ATTRIBUTE,
+ errorbuf);
+ }
+ }
+ } else {
+ slapi_ch_free((void **)&instancedir);
+ }
+ }
+
/* increase file descriptors */
#if !defined(_WIN32) && !defined(AIX)
if (!maxdescriptors[0] &&
@@ -301,12 +333,13 @@
#endif
/* set the log file name */
- if (!errorlog[0] &&
+ workpath[0] = '\0';
+ if (!workpath[0] &&
entry_has_attr_and_value(e, CONFIG_ERRORLOG_ATTRIBUTE,
- errorlog, sizeof(errorlog)))
+ workpath, sizeof(workpath)))
{
if (config_set_errorlog(CONFIG_ERRORLOG_ATTRIBUTE,
- errorlog, errorbuf, CONFIG_APPLY) != LDAP_SUCCESS)
+ workpath, errorbuf, CONFIG_APPLY) != LDAP_SUCCESS)
{
LDAPDebug(LDAP_DEBUG_ANY, "%s: %s: %s. \n", configfile,
CONFIG_ERRORLOG_ATTRIBUTE, errorbuf);
@@ -485,6 +518,18 @@
slapi_entry_free(e);
}
+ /*
+ * check if the instance dir is set.
+ */
+ if ( NULL == ( instancedir = config_get_instancedir() )) {
+ slapi_log_error(SLAPI_LOG_FATAL, "startup",
+ "Instance directory is not specifiled in the file %s. It is mandatory.\n",
+ configfile);
+ exit (1);
+ } else {
+ slapi_ch_free((void **)&instancedir);
+ }
+
/* kexcoff: initialize rootpwstoragescheme and pw_storagescheme
* if not explicilty set in the config file
*/
Index: dse.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/dse.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- dse.c 19 Apr 2005 22:07:36 -0000 1.5
+++ dse.c 27 Sep 2006 23:40:51 -0000 1.6
@@ -38,10 +38,9 @@
/*
* dse.c - DSE (DSA-Specific Entry) persistent storage.
*
- * The DSE store is an LDIF file contained in the file
- * INSTANCEDIR/config/XXX.ldif, where INSTANCEDIR is
- * the directory of the server instance, and XXX is
- * dfined by the caller of dse_new.
+ * The DSE store is an LDIF file contained in the file dse.ldif.
+ * The file is located in the directory specified with '-D'
+ * when staring the server.
*
* In core, the DSEs are stored in an AVL tree, keyed on
* DN. Whenever a modification is made to a DSE, the
@@ -354,14 +353,15 @@
dse_new( char *filename, char *tmpfilename, char *backfilename, char *startokfilename, const char *configdir)
{
struct dse *pdse= NULL;
- const char *config_sub_dir = "config";
- char *id = config_get_instancedir();
char *realconfigdir = NULL;
- if (configdir!=NULL) {
- realconfigdir = slapi_ch_strdup(configdir);
- } else if (id!=NULL) {
- realconfigdir = slapi_ch_smprintf("%s/%s", id, config_sub_dir);
+ if (configdir!=NULL)
+ {
+ realconfigdir = slapi_ch_strdup(configdir);
+ }
+ else
+ {
+ realconfigdir = config_get_configdir();
}
if(realconfigdir!=NULL)
{
@@ -412,7 +412,6 @@
}
slapi_ch_free( (void **) &realconfigdir );
}
- slapi_ch_free( (void **) &id );
return pdse;
}
Index: fedse.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/fedse.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- fedse.c 19 Apr 2005 22:07:36 -0000 1.7
+++ fedse.c 27 Sep 2006 23:40:51 -0000 1.8
@@ -38,9 +38,9 @@
/*
* fedse.c - Front End DSE (DSA-Specific Entry) persistent storage.
*
- * The DSE store is an LDIF file contained in the file
- * INSTANCEDIR/config/dse.ldif, where INSTANCEDIR is
- * the directory of the server instance.
+ * The DSE store is an LDIF file contained in the file dse.ldif.
+ * The file is located in the directory specified with '-D'
+ * when staring the server.
*
* In core, the DSEs are stored in an AVL tree, keyed on
* DN. Whenever a modification is made to a DSE, the
@@ -1866,48 +1866,54 @@
int fedse_create_startOK(char *filename, char *startokfilename, const char *configdir)
{
- const char *config_sub_dir = "config";
- char *id = config_get_instancedir();
char *realconfigdir = NULL;
- char *dse_filename = NULL;
- char *dse_filestartOK = NULL;
- int rc = -1;
+ char *dse_filename = NULL;
+ char *dse_filestartOK = NULL;
+ int rc = -1;
- if (configdir!=NULL) {
+ if (configdir!=NULL)
+ {
realconfigdir = slapi_ch_strdup(configdir);
- } else if (id!=NULL) {
- realconfigdir = slapi_ch_smprintf("%s/%s", id, config_sub_dir);
}
- slapi_ch_free_string(&id);
+ else
+ {
+ realconfigdir = config_get_configdir();
+ }
if(realconfigdir!=NULL)
{
- /* Set the full path name for the config DSE entry */
- if (!strstr(filename, realconfigdir))
- {
- dse_filename = slapi_ch_smprintf("%s/%s", realconfigdir, filename );
- }
- else
- dse_filename = slapi_ch_strdup(filename);
+ /* Set the full path name for the config DSE entry */
+ if (!strstr(filename, realconfigdir))
+ {
+ dse_filename = slapi_ch_smprintf("%s/%s", realconfigdir, filename);
+ }
+ else
+ {
+ dse_filename = slapi_ch_strdup(filename);
+ }
- if (!strstr(startokfilename, realconfigdir)) {
- dse_filestartOK = slapi_ch_smprintf("%s/%s", realconfigdir, startokfilename );
- }
- else
- dse_filestartOK = slapi_ch_strdup(startokfilename);
+ if (!strstr(startokfilename, realconfigdir))
+ {
+ dse_filestartOK = slapi_ch_smprintf("%s/%s",
+ realconfigdir, startokfilename);
+ }
+ else
+ {
+ dse_filestartOK = slapi_ch_strdup(startokfilename);
+ }
- rc = slapi_copy(dse_filename, dse_filestartOK);
- if ( rc != 0 )
- {
- slapi_log_error( SLAPI_LOG_FATAL, "dse", "Cannot copy"
- " DSE file \"%s\" to \"%s\" OS error %d (%s)\n",
- dse_filename, dse_filestartOK,
- rc, slapd_system_strerror(rc) );
- }
-
- slapi_ch_free_string(&dse_filename);
- slapi_ch_free_string(&dse_filestartOK);
- slapi_ch_free_string(&realconfigdir);
- }
+ rc = slapi_copy(dse_filename, dse_filestartOK);
+ if ( rc != 0 )
+ {
+ slapi_log_error( SLAPI_LOG_FATAL, "dse", "Cannot copy"
+ " DSE file \"%s\" to \"%s\" OS error %d (%s)\n",
+ dse_filename, dse_filestartOK,
+ rc, slapd_system_strerror(rc) );
+ }
+
+ slapi_ch_free_string(&dse_filename);
+ slapi_ch_free_string(&dse_filestartOK);
+ slapi_ch_free_string(&realconfigdir);
+ }
- return rc;
+ return rc;
}
Index: libglobs.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/libglobs.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- libglobs.c 31 Aug 2006 22:52:07 -0000 1.9
+++ libglobs.c 27 Sep 2006 23:40:51 -0000 1.10
@@ -513,9 +513,16 @@
CONFIG_CONSTANT_STRING, NULL},
{CONFIG_HASH_FILTERS_ATTRIBUTE, config_set_hash_filters,
NULL, 0, NULL, CONFIG_ON_OFF, (ConfigGetFunc)config_get_hash_filters},
- {CONFIG_INSTANCEDIR_ATTRIBUTE, NULL /* read only */,
+ {CONFIG_INSTANCEDIR_ATTRIBUTE, config_set_instancedir,
NULL, 0,
(void**)&global_slapdFrontendConfig.instancedir, CONFIG_STRING, NULL},
+ /* parameterizing schema dir */
+ {CONFIG_SCHEMADIR_ATTRIBUTE, config_set_schemadir,
+ NULL, 0,
+ (void**)&global_slapdFrontendConfig.schemadir, CONFIG_STRING, NULL},
+ /* parameterizing ldif dir */
+ {CONFIG_LDIFDIR_ATTRIBUTE, config_set_ldifdir,
+ NULL, 0, NULL, CONFIG_STRING, NULL},
{CONFIG_REWRITE_RFC1274_ATTRIBUTE, config_set_rewrite_rfc1274,
NULL, 0,
(void**)&global_slapdFrontendConfig.rewrite_rfc1274, CONFIG_ON_OFF, NULL},
@@ -2344,7 +2351,7 @@
/* Set the slapd type also */
config_set_slapd_type ();
- /* Set the configdir if not set */
+ /* Set the configdir if not set (it must be set since 7.2) */
if (!slapdFrontendConfig->configdir)
{
char newdir[MAXPATHLEN+1];
@@ -4220,6 +4227,49 @@
return retVal;
}
+char *
+config_get_schemadir()
+{
+ slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig();
+ char *retVal;
+
+ CFG_LOCK_READ(slapdFrontendConfig);
+ retVal = config_copy_strval(slapdFrontendConfig->schemadir);
+ CFG_UNLOCK_READ(slapdFrontendConfig);
+
+ return retVal;
+}
+
+int
+config_set_schemadir(const char *attrname, char *value, char *errorbuf, int apply)
+{
+ int retVal = LDAP_SUCCESS;
+ slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig();
+
+ if ( config_value_is_null( attrname, value, errorbuf, 0 )) {
+ return LDAP_OPERATIONS_ERROR;
+ }
+
+ if (!apply) {
+ return retVal;
+ }
+
+ CFG_LOCK_WRITE(slapdFrontendConfig);
+ slapi_ch_free((void **)&slapdFrontendConfig->schemadir);
+
+ slapdFrontendConfig->schemadir = slapi_ch_strdup(value);
+
+ CFG_UNLOCK_WRITE(slapdFrontendConfig);
+ return retVal;
+}
+
+int
+config_set_ldifdir(const char *attrname, char *value, char *errorbuf, int apply)
+{
+ /* noop */
+ return LDAP_SUCCESS;
+}
+
char **
config_get_errorlog_list()
{
Index: main.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/main.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- main.c 23 Nov 2005 17:58:01 -0000 1.11
+++ main.c 27 Sep 2006 23:40:51 -0000 1.12
@@ -255,7 +255,7 @@
}
/* Changes the owner of the files in the logs and
- * config directorys to the user that the server runs as.
+ * config directory to the user that the server runs as.
*/
static void
@@ -276,13 +276,26 @@
}
/* The instance directory needs to be owned by the local user */
- slapd_chown_if_not_owner( slapdFrontendConfig->instancedir, pw->pw_uid, -1 );
- PR_snprintf(dirname,sizeof(dirname),"%s/config",slapdFrontendConfig->instancedir);
- chown_dir_files(dirname, pw, PR_FALSE); /* config directory */
- chown_dir_files(slapdFrontendConfig->accesslog, pw, PR_TRUE); /* do access log directory */
- chown_dir_files(slapdFrontendConfig->auditlog, pw, PR_TRUE); /* do audit log directory */
- chown_dir_files(slapdFrontendConfig->errorlog, pw, PR_TRUE); /* do error log directory */
-
+ if (slapdFrontendConfig->instancedir) {
+ slapd_chown_if_not_owner(slapdFrontendConfig->instancedir,
+ pw->pw_uid, -1);
+ }
+ /* config directory */
+ if (slapdFrontendConfig->configdir) {
+ chown_dir_files(slapdFrontendConfig->configdir, pw, PR_FALSE);
+ }
+ /* do access log file, if any */
+ if (slapdFrontendConfig->accesslog) {
+ chown_dir_files(slapdFrontendConfig->accesslog, pw, PR_TRUE);
+ }
+ /* do audit log file, if any */
+ if (slapdFrontendConfig->auditlog) {
+ chown_dir_files(slapdFrontendConfig->auditlog, pw, PR_TRUE);
+ }
+ /* do error log file, if any */
+ if (slapdFrontendConfig->errorlog) {
+ chown_dir_files(slapdFrontendConfig->errorlog, pw, PR_TRUE);
+ }
}
#endif
@@ -365,7 +378,7 @@
}
#endif
else if ( exit_if_unknown ) {
- fprintf( stderr, "usage: %s -D instancedir "
+ fprintf( stderr, "usage: %s -D configdir "
"[ldif2db | db2ldif | archive2db "
"| db2archive | db2index | refer | suffix2instance"
#if defined(UPGRADEDB)
@@ -397,46 +410,46 @@
switch( slapd_exemode ) {
case SLAPD_EXEMODE_DB2LDIF:
- usagestr = "usage: %s %s%s-D instancedir [-n backend-instance-name] [-d debuglevel] "
+ usagestr = "usage: %s %s%s-D configdir [-n backend-instance-name] [-d debuglevel] "
"[-N] [-a outputfile] [-r] [-C] [{-s includesuffix}*] "
"[{-x excludesuffix}*] [-u] [-U] [-m] [-M] [-E]\n"
"Note: either \"-n backend_instance_name\" or \"-s includesuffix\" is required.\n";
break;
case SLAPD_EXEMODE_LDIF2DB:
- usagestr = "usage: %s %s%s-D instancedir [-d debuglevel] "
+ usagestr = "usage: %s %s%s-D configdir [-d debuglevel] "
"[-n backend_instance_name] [-O] [-g uniqueid_type] [--namespaceid uniqueID]"
"[{-s includesuffix}*] [{-x excludesuffix}*] [-E] {-i ldif-file}*\n"
"Note: either \"-n backend_instance_name\" or \"-s includesuffix\" is required.\n";
break;
case SLAPD_EXEMODE_DB2ARCHIVE:
- usagestr = "usage: %s %s%s-D instancedir [-d debuglevel] -a archivedir\n";
+ usagestr = "usage: %s %s%s-D configdir [-d debuglevel] -a archivedir\n";
break;
case SLAPD_EXEMODE_ARCHIVE2DB:
- usagestr = "usage: %s %s%s-D instancedir [-d debuglevel] -a archivedir\n";
+ usagestr = "usage: %s %s%s-D configdir [-d debuglevel] -a archivedir\n";
break;
case SLAPD_EXEMODE_DB2INDEX:
- usagestr = "usage: %s %s%s-D instancedir -n backend-instance-name "
+ usagestr = "usage: %s %s%s-D configdir -n backend-instance-name "
"[-d debuglevel] {-t attributetype}* {-T VLV Search Name}*\n";
/* JCM should say 'Address Book' or something instead of VLV */
break;
case SLAPD_EXEMODE_REFERRAL:
- usagestr = "usage: %s %s%s-D instancedir -r referral-url [-p port]\n";
+ usagestr = "usage: %s %s%s-D configdir -r referral-url [-p port]\n";
break;
case SLAPD_EXEMODE_DBTEST:
- usagestr = "usage: %s %s%s-D instancedir -n backend-instance-name "
+ usagestr = "usage: %s %s%s-D configdir -n backend-instance-name "
"[-d debuglevel] [-S] [-v]\n";
break;
case SLAPD_EXEMODE_SUFFIX2INSTANCE:
- usagestr = "usage: %s %s%s -D instancedir {-s suffix}*\n";
+ usagestr = "usage: %s %s%s -D configdir {-s suffix}*\n";
break;
#if defined(UPGRADEDB)
case SLAPD_EXEMODE_UPGRADEDB:
- usagestr = "usage: %s %s%s-D instancedir [-d debuglevel] [-f] -a archivedir\n";
+ usagestr = "usage: %s %s%s-D configdir [-d debuglevel] [-f] -a archivedir\n";
break;
#endif
default: /* SLAPD_EXEMODE_SLAPD */
- usagestr = "usage: %s %s%s-D instancedir [-d debuglevel] "
+ usagestr = "usage: %s %s%s-D configdir [-d debuglevel] "
"[-i pidlogfile] [-v] [-V]\n";
}
@@ -683,9 +696,9 @@
}
#endif
- process_command_line(argc,argv,myname,&extraname);
+ process_command_line(argc,argv,myname,&extraname);
- if (!slapdFrontendConfig->instancedir ||
+ if (!slapdFrontendConfig->instancedir &&
!slapdFrontendConfig->configdir) {
usage( myname, extraname );
exit( 1 );
@@ -698,7 +711,7 @@
}
#ifndef LDAP_DONT_USE_SMARTHEAP
- MemRegisterTask();
+ MemRegisterTask();
#endif
slapd_init();
@@ -706,39 +719,52 @@
vattr_init();
if (slapd_exemode == SLAPD_EXEMODE_REFERRAL) {
- /* make up the config stuff */
- referral_set_defaults();
- n_port = config_get_port();
- s_port = config_get_secureport();
+ slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig();
+ /* make up the config stuff */
+ referral_set_defaults();
+ /*
+ * Process the config files.
+ */
+ if (0 == slapd_bootstrap_config(slapdFrontendConfig->configdir)) {
+ slapi_log_error(SLAPI_LOG_FATAL, "startup",
+ "The configuration files in directory %s could not be read or were not found. Please refer to the error log or output for more information.\n",
+ slapdFrontendConfig->configdir);
+ exit(1);
+ }
+
+ n_port = config_get_port();
+ s_port = config_get_secureport();
register_objects();
} else {
- slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig();
- /* The 2 calls below have been moved to this place to make sure that they
- * are called before setup_internal_backends to avoid bug 524439 */
- /*
- * The 2 calls below where being sometimes called AFTER ldapi_register_extended_op
- * (such fact was being stated and reproducible for some optimized installations
- * at startup (bug 524439)... Such bad call was happening in the context of
- * setup_internal_backends -> dse_read_file -> load_plugin_entry ->
- * plugin_setup -> replication_multimaster_plugin_init ->
- * slapi_register_plugin -> plugin_setup -> multimaster_start_extop_init ->
- * slapi_pblock_set -> ldapi_register_extended_op... Unfortunately, the server
- * design is such that it is assumed that ldapi_init_extended_ops is always
- * called first.
- * THE FIX: Move the two calls below before a call to setup_internal_backends
- * (down in this same function)
- */
- init_saslmechanisms();
- ldapi_init_extended_ops();
+ slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig();
+ /* The 2 calls below have been moved to this place to make sure that
+ * they are called before setup_internal_backends to avoid bug 524439 */
+ /*
+ * The 2 calls below where being sometimes called AFTER
+ * ldapi_register_extended_op (such fact was being stated and
+ * reproducible for some optimized installations at startup (bug
+ * 524439)... Such bad call was happening in the context of
+ * setup_internal_backends -> dse_read_file -> load_plugin_entry ->
+ * plugin_setup -> replication_multimaster_plugin_init ->
+ * slapi_register_plugin -> plugin_setup ->
+ * multimaster_start_extop_init -> * slapi_pblock_set ->
+ * ldapi_register_extended_op... Unfortunately, the server
+ * design is such that it is assumed that ldapi_init_extended_ops is
+ * always called first.
+ * THE FIX: Move the two calls below before a call to
+ * setup_internal_backends (down in this same function)
+ */
+ init_saslmechanisms();
+ ldapi_init_extended_ops();
- /*
- * Initialize the default backend. This should be done before we
- * process the config. files
- */
- defbackend_init();
-
+ /*
+ * Initialize the default backend. This should be done before we
+ * process the config. files
+ */
+ defbackend_init();
+
/*
* Register the extensible objects with the factory.
*/
@@ -746,12 +772,12 @@
/*
* Register the controls that we support.
*/
- init_controls();
+ init_controls();
- /*
- * Process the config files.
- */
- if (0 == slapd_bootstrap_config(slapdFrontendConfig->configdir)) {
+ /*
+ * Process the config files.
+ */
+ if (0 == slapd_bootstrap_config(slapdFrontendConfig->configdir)) {
slapi_log_error(SLAPI_LOG_FATAL, "startup",
"The configuration files in directory %s could not be read or were not found. Please refer to the error log or output for more information.\n",
slapdFrontendConfig->configdir);
@@ -759,7 +785,7 @@
}
/* -sduloutre: must be done before any internal search */
- /* do it before splitting off to other modes too -robey */
+ /* do it before splitting off to other modes too -robey */
/* -richm: must be done before reading config files */
if (0 != (return_value = compute_init())) {
LDAPDebug(LDAP_DEBUG_ANY, "Initialization Failed 0 %d\n",return_value,0,0);
@@ -774,8 +800,8 @@
exit(1);
}
- n_port = config_get_port();
- s_port = config_get_secureport();
+ n_port = config_get_port();
+ s_port = config_get_secureport();
}
raise_process_limits(); /* should be done ASAP once config file read */
@@ -792,22 +818,22 @@
set_entry_points();
#if defined( XP_WIN32 )
- if (slapd_exemode == SLAPD_EXEMODE_SLAPD) {
- /* Register with the NT EventLog */
- hSlapdEventSource = RegisterEventSource(NULL, pszServerName );
- if( !hSlapdEventSource ) {
- char szMessage[256];
- PR_snprintf( szMessage, sizeof(szMessage), "Directory Server %s is terminating. Failed "
- "to set the EventLog source.", pszServerName);
- MessageBox(GetDesktopWindow(), szMessage, " ",
- MB_ICONEXCLAMATION | MB_OK);
- exit( 1 );
- }
+ if (slapd_exemode == SLAPD_EXEMODE_SLAPD) {
+ /* Register with the NT EventLog */
+ hSlapdEventSource = RegisterEventSource(NULL, pszServerName );
+ if( !hSlapdEventSource ) {
+ char szMessage[256];
+ PR_snprintf( szMessage, sizeof(szMessage), "Directory Server %s is terminating. Failed "
+ "to set the EventLog source.", pszServerName);
+ MessageBox(GetDesktopWindow(), szMessage, " ",
+ MB_ICONEXCLAMATION | MB_OK);
+ exit( 1 );
+ }
- /* Check to ensure there isn't a copy of this server already running. */
- if( MultipleInstances() )
- exit( 1 );
- }
+ /* Check to ensure there isn't a copy of this server already running. */
+ if( MultipleInstances() )
+ exit( 1 );
+ }
#endif
/*
@@ -826,8 +852,8 @@
* we need to be root in order to open them.
*/
- if ((slapd_exemode == SLAPD_EXEMODE_SLAPD) ||
- (slapd_exemode == SLAPD_EXEMODE_REFERRAL)) {
+ if ((slapd_exemode == SLAPD_EXEMODE_SLAPD) ||
+ (slapd_exemode == SLAPD_EXEMODE_REFERRAL)) {
ports_info.n_port = (unsigned short)n_port;
if ( slapd_listenhost2addr( config_get_listenhost(),
&ports_info.n_listenaddr ) != 0 ) {
@@ -842,9 +868,9 @@
return_value = daemon_pre_setuid_init(&ports_info);
if (0 != return_value) {
- LDAPDebug( LDAP_DEBUG_ANY, "Failed to init daemon\n",
- 0, 0, 0 );
- exit(1);
+ LDAPDebug( LDAP_DEBUG_ANY, "Failed to init daemon\n",
+ 0, 0, 0 );
+ exit(1);
}
}
@@ -853,9 +879,9 @@
#ifndef _WIN32
return_value = main_setuid(slapdFrontendConfig->localuser);
if (0 != return_value) {
- LDAPDebug( LDAP_DEBUG_ANY, "Failed to change user and group identity to that of %s\n",
+ LDAPDebug( LDAP_DEBUG_ANY, "Failed to change user and group identity to that of %s\n",
slapdFrontendConfig->localuser, 0, 0 );
- exit(1);
+ exit(1);
}
#endif
@@ -870,7 +896,7 @@
&& (0 != s_port) && (s_port <= LDAP_PORT_MAX);
/* As of DS 6.1, always do a full initialization so that other
* modules can assume NSS is available
- */
+ */
if ( slapd_nss_init((slapd_exemode == SLAPD_EXEMODE_SLAPD),
(slapd_exemode != SLAPD_EXEMODE_REFERRAL) /* have config? */ )) {
LDAPDebug(LDAP_DEBUG_ANY,
@@ -888,14 +914,14 @@
exit( 1 );
}
- if ((slapd_exemode == SLAPD_EXEMODE_SLAPD) ||
- (slapd_exemode == SLAPD_EXEMODE_REFERRAL)) {
- if ( init_ssl && ( 0 != slapd_ssl_init2(&ports_info.s_socket, 0) ) ) {
- LDAPDebug(LDAP_DEBUG_ANY,
- "ERROR: SSL Initialization phase 2 Failed.\n", 0, 0, 0 );
- exit( 1 );
- }
- }
+ if ((slapd_exemode == SLAPD_EXEMODE_SLAPD) ||
+ (slapd_exemode == SLAPD_EXEMODE_REFERRAL)) {
+ if ( init_ssl && ( 0 != slapd_ssl_init2(&ports_info.s_socket, 0) ) ) {
+ LDAPDebug(LDAP_DEBUG_ANY,
+ "ERROR: SSL Initialization phase 2 Failed.\n", 0, 0, 0 );
+ exit( 1 );
+ }
+ }
/*
* if we were called upon to do special database stuff, do it and be
@@ -903,52 +929,52 @@
*/
switch ( slapd_exemode ) {
case SLAPD_EXEMODE_LDIF2DB:
- return slapd_exemode_ldif2db();
+ return slapd_exemode_ldif2db();
case SLAPD_EXEMODE_DB2LDIF:
- return slapd_exemode_db2ldif(argc,argv);
+ return slapd_exemode_db2ldif(argc,argv);
case SLAPD_EXEMODE_DB2INDEX:
- return slapd_exemode_db2index();
+ return slapd_exemode_db2index();
case SLAPD_EXEMODE_ARCHIVE2DB:
- return slapd_exemode_archive2db();
+ return slapd_exemode_archive2db();
case SLAPD_EXEMODE_DB2ARCHIVE:
- return slapd_exemode_db2archive();
+ return slapd_exemode_db2archive();
case SLAPD_EXEMODE_DBTEST:
- return slapd_exemode_dbtest();
+ return slapd_exemode_dbtest();
case SLAPD_EXEMODE_REFERRAL:
/* check that all the necessary info was given, then go on */
- if (! config_check_referral_mode()) {
- LDAPDebug(LDAP_DEBUG_ANY,
- "ERROR: No referral URL supplied\n", 0, 0, 0);
+ if (! config_check_referral_mode()) {
+ LDAPDebug(LDAP_DEBUG_ANY,
+ "ERROR: No referral URL supplied\n", 0, 0, 0);
usage( myname, extraname );
- exit(1);
+ exit(1);
}
break;
case SLAPD_EXEMODE_SUFFIX2INSTANCE:
- return slapd_exemode_suffix2instance();
+ return slapd_exemode_suffix2instance();
#if defined(UPGRADEDB)
case SLAPD_EXEMODE_UPGRADEDB:
- return slapd_exemode_upgradedb();
+ return slapd_exemode_upgradedb();
#endif
case SLAPD_EXEMODE_PRINTVERSION:
- slapd_print_version(1);
- exit(1);
+ slapd_print_version(1);
+ exit(1);
}
/*
* Detach ourselves from the terminal (unless running in debug mode).
* We must detach before we start any threads since detach forks() on
* UNIX.
- * Have to detach after ssl_init - the user may be prompted for the PIN
- * on the terminal, so it must be open.
+ * Have to detach after ssl_init - the user may be prompted for the PIN
+ * on the terminal, so it must be open.
*/
detach();
@@ -969,8 +995,8 @@
* slapd processes that are currently running
*/
if ((slapd_exemode != SLAPD_EXEMODE_REFERRAL) &&
- ( add_new_slapd_process(slapd_exemode, db2ldif_dump_replica,
- skip_db_protect_check) == -1 )) {
+ ( add_new_slapd_process(slapd_exemode, db2ldif_dump_replica,
+ skip_db_protect_check) == -1 )) {
LDAPDebug( LDAP_DEBUG_ANY,
"Shutting down due to possible conflicts with other slapd processes\n",
0, 0, 0 );
@@ -988,7 +1014,7 @@
char *versionstring = config_get_versionstring();
char *buildnum = config_get_buildnum();
LDAPDebug( LDAP_DEBUG_ANY, "%s B%s starting up\n",
- versionstring, buildnum, 0 );
+ versionstring, buildnum, 0 );
slapi_ch_free((void **)&buildnum);
slapi_ch_free((void **)&versionstring);
}
@@ -1003,8 +1029,8 @@
slapdFrontendConfig->configdir);
eq_init(); /* must be done before plugins started */
- snmp_collator_start();
- ps_init_psearch_system(); /* must come before plugin_startall() */
+ snmp_collator_start();
+ ps_init_psearch_system(); /* must come before plugin_startall() */
/* Initailize the mapping tree */
@@ -1012,12 +1038,12 @@
{
LDAPDebug( LDAP_DEBUG_ANY, "Failed to init mapping tree\n",
0, 0, 0 );
- exit(1);
+ exit(1);
}
/* initialize UniqueID generator - must be done once backends are started
- and event queue is initialized but before plugins are started */
+ and event queue is initialized but before plugins are started */
sdn = slapi_sdn_new_dn_byval ("cn=uniqueid generator,cn=config");
rc = uniqueIDGenInit (NULL, sdn, slapd_exemode == SLAPD_EXEMODE_SLAPD);
slapi_sdn_free (&sdn);
@@ -1025,7 +1051,7 @@
{
LDAPDebug( LDAP_DEBUG_ANY,
"Fatal Error---Failed to initialize uniqueid generator; error = %d. "
- "Exiting now.\n", rc, 0, 0 );
+ "Exiting now.\n", rc, 0, 0 );
exit( 1 );
}
@@ -1034,17 +1060,17 @@
if ( slapd_security_library_is_initialized() != 0 ) {
- start_tls_register_plugin();
+ start_tls_register_plugin();
LDAPDebug( LDAP_DEBUG_PLUGIN,
- "Start TLS plugin registered.\n",
- 0, 0, 0 );
+ "Start TLS plugin registered.\n",
+ 0, 0, 0 );
}
#endif
- passwd_modify_register_plugin();
- LDAPDebug( LDAP_DEBUG_PLUGIN,
- "Password Modify plugin registered.\n", 0, 0, 0 );
+ passwd_modify_register_plugin();
+ LDAPDebug( LDAP_DEBUG_PLUGIN,
+ "Password Modify plugin registered.\n", 0, 0, 0 );
- plugin_startall(argc, argv, 1 /* Start Backends */, 1 /* Start Globals */);
+ plugin_startall(argc, argv, 1 /* Start Backends */, 1 /* Start Globals */);
if (housekeeping_start((time_t)0, NULL) == NULL) {
exit (1);
}
@@ -1052,50 +1078,50 @@
eq_start(); /* must be done after plugins started */
#ifdef HPUX10
- /* HPUX linker voodoo */
- if (collation_init == NULL) {
+ /* HPUX linker voodoo */
+ if (collation_init == NULL) {
exit (1);
- }
-
+ }
+
#endif /* HPUX */
- normalize_oc();
+ normalize_oc();
- if (n_port) {
+ if (n_port) {
#if defined(NET_SSL)
- } else if ( config_get_security()) {
+ } else if ( config_get_security()) {
#endif
- } else {
+ } else {
#ifdef _WIN32
- if( SlapdIsAService() )
- {
- LDAPServerStatus.dwCurrentState = SERVICE_STOPPED;
- LDAPServerStatus.dwCheckPoint = 0;
- LDAPServerStatus.dwWaitHint = 0;
- LDAPServerStatus.dwWin32ExitCode = 1;
- LDAPServerStatus.dwServiceSpecificExitCode = 1;
-
- SetServiceStatus(hLDAPServerServiceStatus, &LDAPServerStatus);
-
- /* Log this event */
- ReportSlapdEvent(EVENTLOG_INFORMATION_TYPE, MSG_SERVER_START_FAILED, 1,
- "Check server port specification");
- }
- else
- {
- char szMessage[256];
- PR_snprintf( szMessage, sizeof(szMessage), "The Directory Server %s is terminating due to an error. Check server port specification", pszServerName);
- MessageBox(GetDesktopWindow(), szMessage, " ", MB_ICONEXCLAMATION | MB_OK);
- }
+ if( SlapdIsAService() )
+ {
+ LDAPServerStatus.dwCurrentState = SERVICE_STOPPED;
+ LDAPServerStatus.dwCheckPoint = 0;
+ LDAPServerStatus.dwWaitHint = 0;
+ LDAPServerStatus.dwWin32ExitCode = 1;
+ LDAPServerStatus.dwServiceSpecificExitCode = 1;
+
+ SetServiceStatus(hLDAPServerServiceStatus, &LDAPServerStatus);
+
+ /* Log this event */
+ ReportSlapdEvent(EVENTLOG_INFORMATION_TYPE, MSG_SERVER_START_FAILED, 1,
+ "Check server port specification");
+ }
+ else
+ {
+ char szMessage[256];
+ PR_snprintf( szMessage, sizeof(szMessage), "The Directory Server %s is terminating due to an error. Check server port specification", pszServerName);
+ MessageBox(GetDesktopWindow(), szMessage, " ", MB_ICONEXCLAMATION | MB_OK);
+ }
#endif
- exit(1);
- }
+ exit(1);
+ }
}
- {
- Slapi_PBlock pb;
- memset( &pb, '\0', sizeof(pb) );
- pb.pb_backend = be;
+ {
+ Slapi_PBlock pb;
+ memset( &pb, '\0', sizeof(pb) );
+ pb.pb_backend = be;
}
if (slapd_exemode != SLAPD_EXEMODE_REFERRAL) {
@@ -1224,7 +1250,7 @@
{"debug",ArgRequired,'d'},
{"backend",ArgRequired,'n'},
{"allowMultipleProcesses",ArgNone,'S'},
- {"instanceDir",ArgRequired,'D'},
+ {"configDir",ArgRequired,'D'},
{0,0,0}};
@@ -1240,7 +1266,7 @@
/*{"whatshouldwecallthis",ArgNone,'C'},*/
{"allowMultipleProcesses",ArgNone,'S'},
{"noUniqueIds",ArgNone,'u'},
- {"instanceDir",ArgRequired,'D'},
+ {"configDir",ArgRequired,'D'},
{"encrypt",ArgOptional,'E'},
{"nowrap",ArgNone,'U'},
{"minimalEncode",ArgNone,'m'},
@@ -1264,7 +1290,7 @@
{"allowMultipleProcesses",ArgNone,'S'},
{"namespaceid", ArgRequired, 'G'},
{"nostate",ArgNone,'Z'},
- {"instanceDir",ArgRequired,'D'},
+ {"configDir",ArgRequired,'D'},
{"encrypt",ArgOptional,'E'},
{0,0,0}};
@@ -1276,7 +1302,7 @@
{"archive",ArgRequired,'a'},
{"backEndInstName",ArgRequired,'n'},
{"allowMultipleProcesses",ArgNone,'S'},
- {"instanceDir",ArgRequired,'D'},
+ {"configDir",ArgRequired,'D'},
{0,0,0}};
@@ -1287,7 +1313,7 @@
{"pidfile",ArgRequired,'i'},
{"archive",ArgRequired,'a'},
{"allowMultipleProcesses",ArgNone,'S'},
- {"instanceDir",ArgRequired,'D'},
+ {"configDir",ArgRequired,'D'},
{0,0,0}};
char *opts_db2index = "vd:a:t:T:SD:n:s:x:";
@@ -1299,7 +1325,7 @@
{"indexAttribute",ArgRequired,'t'},
{"vlvIndex",ArgRequired,'T'},
{"allowMultipleProcesses",ArgNone,'S'},
- {"instanceDir",ArgRequired,'D'},
+ {"configDir",ArgRequired,'D'},
{"include",ArgRequired,'s'},
{"exclude",ArgRequired,'x'},
{0,0,0}};
@@ -1311,7 +1337,7 @@
{"debug",ArgRequired,'d'},
{"force",ArgNone,'f'},
{"archive",ArgRequired,'a'},
- {"instanceDir",ArgRequired,'D'},
+ {"configDir",ArgRequired,'D'},
{0,0,0}};
#endif
@@ -1322,7 +1348,7 @@
{"port",ArgRequired,'p'},
{"referralMode",ArgRequired,'r'},
{"allowMultipleProcesses",ArgNone,'S'},
- {"instanceDir",ArgRequired,'D'},
+ {"configDir",ArgRequired,'D'},
{0,0,0}};
char *opts_suffix2instance = "s:D:";
@@ -1338,7 +1364,7 @@
{"debug",ArgRequired,'d'},
{"pidfile",ArgRequired,'i'},
{"allowMultipleProcesses",ArgNone,'S'},
- {"instanceDir",ArgRequired,'D'},
+ {"configDir",ArgRequired,'D'},
{"startpidfile",ArgRequired,'w'},
{0,0,0}};
@@ -1420,7 +1446,7 @@
while ( (i = getopt_ext( argc, argv, opts,
long_opts, &longopt_index)) != EOF ) {
- char *instancedir = 0;
+ char *configdir = 0;
switch ( i ) {
#ifdef LDAP_DEBUG
case 'd': /* turn on debugging */
@@ -1446,11 +1472,11 @@
#endif
case 'D': /* config dir */
- instancedir = rel2abspath( optarg_ext );
+ configdir = rel2abspath( optarg_ext );
#if defined( XP_WIN32 )
pszServerName = slapi_ch_malloc( MAX_SERVICE_NAME );
- if( !SlapdGetServerNameFromCmdline(pszServerName, instancedir, 1) )
+ if( !SlapdGetServerNameFromCmdline(pszServerName, configdir, 1) )
{
MessageBox(GetDesktopWindow(), "Failed to get the Directory"
" Server name from the command-line argument.",
@@ -1458,13 +1484,13 @@
exit( 1 );
}
#endif
- if ( config_set_instancedir( "instancedir (-D)",
- instancedir, errorbuf, 1) != LDAP_SUCCESS ) {
+ if ( config_set_configdir( "configdir (-D)",
+ configdir, errorbuf, 1) != LDAP_SUCCESS ) {
fprintf( stderr, "%s: aborting now\n", errorbuf );
usage( myname, *extraname );
exit( 1 );
}
- slapi_ch_free((void **)&instancedir);
+ slapi_ch_free((void **)&configdir);
break;
Index: proto-slap.h
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/proto-slap.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- proto-slap.h 1 Sep 2006 21:25:08 -0000 1.20
+++ proto-slap.h 27 Sep 2006 23:40:51 -0000 1.21
@@ -301,6 +301,8 @@
int config_set_enquote_sup_oc(const char *attrname, char *value, char *errorbuf, int apply );
int config_set_basedn( const char *attrname, char *value, char *errorbuf, int apply );
int config_set_configdir( const char *attrname, char *value, char *errorbuf, int apply );
+int config_set_schemadir( const char *attrname, char *value, char *errorbuf, int apply );
+int config_set_ldifdir( const char *attrname, char *value, char *errorbuf, int apply );
int config_set_attrname_exceptions( const char *attrname, char *value, char *errorbuf, int apply );
int config_set_hash_filters( const char *attrname, char *value, char *errorbuf, int apply );
int config_set_rewrite_rfc1274( const char *attrname, char *value, char *errorbuf, int apply );
@@ -398,6 +400,7 @@
int config_get_enquote_sup_oc();
char *config_get_basedn();
char *config_get_configdir();
+char *config_get_schemadir();
char **config_get_errorlog_list();
char **config_get_accesslog_list();
char **config_get_auditlog_list();
Index: schema.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/schema.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- schema.c 11 Apr 2006 02:14:44 -0000 1.8
+++ schema.c 27 Sep 2006 23:40:51 -0000 1.9
@@ -4014,7 +4014,11 @@
slapi_sdn_init_dn_byref(&schema,"cn=schema");
- schemadir = slapi_ch_smprintf("%s/%s", configdir, SCHEMA_SUBDIR_NAME);
+ schemadir = config_get_schemadir();
+ if (NULL == schemadir) {
+ /* schemadir info is not configured, let's use the default place */
+ schemadir = slapi_ch_smprintf("%s/%s", configdir, SCHEMA_SUBDIR_NAME);
+ }
filelist = get_priority_filelist(schemadir, ".*ldif$");
if (!filelist || !*filelist)
Index: slap.h
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/slap.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- slap.h 31 Aug 2006 22:52:07 -0000 1.14
+++ slap.h 27 Sep 2006 23:40:51 -0000 1.15
@@ -1708,6 +1708,8 @@
#define CONFIG_REWRITE_RFC1274_ATTRIBUTE "nsslapd-rewrite-rfc1274"
#define CONFIG_CONFIG_ATTRIBUTE "nsslapd-config"
+#define CONFIG_SCHEMADIR_ATTRIBUTE "nsslapd-schemadir"
+#define CONFIG_LDIFDIR_ATTRIBUTE "nsslapd-ldifdir"
#define CONFIG_SSLCLIENTAUTH_ATTRIBUTE "nsslapd-SSLclientAuth"
#define CONFIG_SSL_CHECK_HOSTNAME_ATTRIBUTE "nsslapd-ssl-check-hostname"
#define CONFIG_HASH_FILTERS_ATTRIBUTE "nsslapd-hash-filters"
@@ -1882,6 +1884,7 @@
char *workingdir; /* full path of directory before detach */
char *configdir; /* full path name of directory containing configuration files */
+ char *schemadir; /* full path name of directory containing schema files */
int attrname_exceptions; /* if true, allow questionable attribute names */
int rewrite_rfc1274; /* return attrs for both v2 and v3 names */
char *schemareplace; /* see CONFIG_SCHEMAREPLACE_* #defines below */
From fedora-directory-commits at redhat.com Wed Sep 27 23:40:52 2006
From: fedora-directory-commits at redhat.com (Noriko Hosoi (nhosoi))
Date: Wed, 27 Sep 2006 16:40:52 -0700
Subject: [Fedora-directory-commits]
ldapserver/ldap/admin/src cfg_sspt.c, 1.9,
1.10 create_instance.c, 1.28, 1.29 create_instance.h, 1.6,
1.7 ds_newinst.c, 1.4, 1.5 ds_newinst.pl, 1.7,
1.8 makemccvlvindexes, 1.5, 1.6
Message-ID: <200609272341.k8RNfM2A016611@cvs-int.fedora.redhat.com>
Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/admin/src
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv16463/ldap/admin/src
Modified Files:
cfg_sspt.c create_instance.c create_instance.h ds_newinst.c
ds_newinst.pl makemccvlvindexes
Log Message:
[207427] parameterizing the hardcoded paths (Comment #15)
phase 1. parameterizing config, schema and ldif directory
Index: cfg_sspt.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/cfg_sspt.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- cfg_sspt.c 11 Apr 2006 02:14:31 -0000 1.9
+++ cfg_sspt.c 27 Sep 2006 23:40:50 -0000 1.10
@@ -52,7 +52,7 @@
/*#define CGI_DEBUG 1*/
-#define TEST_CONFIG /* for testing cn=config40 dummy entry instead of real one */
+#undef TEST_CONFIG /* for testing cn=config40 dummy entry instead of real one */
char* const NULLSTR = 0;
@@ -1054,6 +1054,7 @@
return ret;
}
+#ifdef TEST_CONFIG
static int
create_configEntry(LDAP* ld)
{
@@ -1121,6 +1122,7 @@
return ret;
}
+#endif
int
create_group(LDAP* ld, char* base, char* group)
@@ -1388,6 +1390,7 @@
return ret;
}
+#ifdef TEST_CONFIG
int
config_configEntry(LDAP* connection, QUERY_VARS* query)
{
@@ -1396,6 +1399,7 @@
int ret = add_aci_v (connection, value_config40DN, ACI_self_allow, NULLSTR);
return ret;
}
+#endif
int
config_suitespot(SLAPD_CONFIG* slapd, QUERY_VARS* query)
@@ -1629,11 +1633,13 @@
write_ldap_info(slapd, query->suffix, query->ssAdmID);
}
+#ifdef TEST_CONFIG
if (!status && query->testconfig)
status = create_configEntry(connection);
if (!status && query->testconfig)
status = config_configEntry(connection, query);
+#endif
if (connection)
ldap_unbind (connection);
Index: create_instance.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/create_instance.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- create_instance.c 14 Sep 2006 20:30:19 -0000 1.28
+++ create_instance.c 27 Sep 2006 23:40:50 -0000 1.29
@@ -82,18 +82,22 @@
#include
#include
#define SHLIB_EXT "dll"
-#else
+
+#else /* !XP_WIN32 */
+
#define NOT_ABSOLUTE_PATH(str) (str[0] != '/')
#include
#include
+#include
+#include
-#if !defined(HPUX) && !defined(LINUX2_0)
+#if !defined(HPUX)
#include /* FD_SETSIZE */
#else
#include /* FD_SETSIZE is in types.h on HPUX */
#endif
-#if !defined(_WIN32) && !defined(AIX)
+#if !defined(AIX)
#include /* get/setrlimit stuff */
#endif
@@ -110,7 +114,7 @@
#define SHLIB_EXT "so"
#endif
-#endif
+#endif /* !XP_WIN32 */
/*
NT doesn't strictly need these, but the libadmin API which is emulated
@@ -124,14 +128,12 @@
#include
#ifdef XP_WIN32
-
OS_TYPE NS_WINAPI INFO_GetOperatingSystem ();
DWORD NS_WINAPI SERVICE_ReinstallNTService( LPCTSTR szServiceName,
LPCTSTR szServiceDisplayName,
LPCTSTR szServiceExe );
-
-
#endif
+
static void ds_gen_index(FILE* f, char* belowdn);
static char *ds_gen_orgchart_conf(char *sroot, char *cs_path, server_config_s *cf);
static char *ds_gen_gw_conf(char *sroot, char *cs_path, server_config_s *cf, int conf_type);
@@ -182,15 +184,6 @@
return 0;
}
-static char *
-myStrdup(const char *s)
-{
- if (s == NULL)
- return (char *)s;
-
- return strdup(s);
-}
-
static int getSuiteSpotUserGroup(server_config_s* cf)
{
#ifdef XP_UNIX
@@ -248,7 +241,7 @@
{
if( (t = strchr(hn, '.')) )
*t = '\0';
- id = PR_smprintf("%s", hn);
+ id = PR_smprintf("%s", hn);
if(t)
*t = '.';
}
@@ -314,20 +307,31 @@
conf->consumerdn = NULL;
conf->disable_schema_checking = NULL;
conf->install_ldif_file = NULL;
-}
+ conf->sysconfdir = NULL;
+ conf->datadir = NULL;
+ conf->docdir = NULL;
+ conf->inst_dir = NULL;
+ conf->config_dir = NULL;
+ conf->schema_dir = NULL;
+ conf->lock_dir = NULL;
+ conf->log_dir = NULL;
+ conf->run_dir = NULL;
+ conf->db_dir = NULL;
+ conf->bak_dir = NULL;
+ conf->ldif_dir = NULL;
+}
/* ----------------- Sanity check a server configuration ------------------ */
-
char *create_instance_checkport(char *, char *);
char *create_instance_checkuser(char *);
int create_instance_numbers(char *);
-int create_instance_exists(char *fn);
+int create_instance_exists(char *fn, int type);
char *create_instance_copy(char *, char *, int);
char *create_instance_concatenate(char *, char *, int);
int create_instance_mkdir(char *, int);
-char *create_instance_mkdir_p(char *, int);
+char *create_instance_mkdir_p(char *, char *, int, struct passwd *);
#if defined( SOLARIS )
/*
@@ -419,8 +423,11 @@
static char *sanity_check(server_config_s *cf, char *param_name)
{
- char *t, fn[PATH_SIZE];
+ char *t;
register int x;
+#if 0
+ char fn[PATH_SIZE];
+#endif
if (!param_name)
return "Parameter param_name is null";
@@ -461,6 +468,7 @@
cf->servid[x]);
}
}
+#if 0
/* has that identifier already been used? */
PR_snprintf(fn, sizeof(fn), "%s%c%s-%s", cf->sroot, FILE_PATHSEP,
PRODUCT_NAME, cf->servid);
@@ -475,6 +483,7 @@
}
}
*/
+#endif
#ifdef XP_UNIX
if( (t = create_instance_checkuser(cf->servuser)) )
@@ -614,10 +623,7 @@
#ifdef XP_UNIX
-#include
-#include
-
-char*
+static char*
chownfile (struct passwd* pw, char* fn)
{
if (pw != NULL && chown (fn, pw->pw_uid, pw->pw_gid) == -1) {
@@ -632,30 +638,14 @@
return NULL;
}
-char *chownlogs(char *sroot, char *user)
-{
- struct passwd *pw;
- char fn[PATH_SIZE];
- if(user && *user && !geteuid()) {
- if(!(pw = getpwnam(user)))
- return make_error("Could not find UID and GID of user '%s'.",
- user);
- PR_snprintf(fn, sizeof(fn), "%s%clogs", sroot, FILE_PATHSEP);
- return chownfile (pw, fn);
- }
- return NULL;
-}
-
-char *chownconfig(char *sroot, char *user)
+static char *
+chowndir(char *dir, char *user)
{
struct passwd *pw;
- char fn[PATH_SIZE];
- if(user && *user && !geteuid()) {
+ if (dir && *dir && user && *user && !geteuid()) {
if(!(pw = getpwnam(user)))
- return make_error("Could not find UID and GID of user '%s'.",
- user);
- PR_snprintf(fn, sizeof(fn), "%s%cconfig", sroot, FILE_PATHSEP);
- return chownfile (pw, fn);
+ return make_error("Could not find UID and GID of user '%s'.", user);
+ return chownfile (pw, dir);
}
return NULL;
}
@@ -663,8 +653,7 @@
#else
#define chownfile(a, b)
-#define chownlogs(a, b)
-#define chownconfig(a, b)
+#define chowndir(a, b)
#define chownsearch(a, b)
#endif
@@ -740,10 +729,10 @@
FILE *f;
va_list args;
- if (PR_FAILURE == PR_Access(cs_path, PR_ACCESS_EXISTS)) {
- printf("Notice: %s does not exist, skipping %s . . .\n", cs_path, name);
- return NULL;
- }
+ if (PR_FAILURE == PR_Access(cs_path, PR_ACCESS_EXISTS)) {
+ printf("Notice: %s does not exist, skipping %s . . .\n", cs_path, name);
+ return NULL;
+ }
PR_snprintf(fn, sizeof(fn), "%s%c%s", cs_path, FILE_PATHSEP, name);
PR_snprintf(myperl, sizeof(myperl), "%s%cbin%cslapd%cadmin%cbin%cperl",
@@ -775,10 +764,10 @@
char fn[PATH_SIZE], ofn[PATH_SIZE];
const char *table[10][2];
- if (PR_FAILURE == PR_Access(cs_path, PR_ACCESS_EXISTS)) {
- printf("Notice: %s does not exist, skipping %s . . .\n", cs_path, name);
- return NULL;
- }
+ if (PR_FAILURE == PR_Access(cs_path, PR_ACCESS_EXISTS)) {
+ printf("Notice: %s does not exist, skipping %s . . .\n", cs_path, name);
+ return NULL;
+ }
PR_snprintf(ofn, sizeof(ofn), "%s%cbin%cslapd%cadmin%cscripts%ctemplate-%s", s_root,
FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP,
@@ -789,7 +778,7 @@
s_root, FILE_PATHSEP, FILE_PATHSEP,
FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP);
#else
- strcpy(myperl, "!/usr/bin/env perl");
+ strcpy(myperl, "!/usr/bin/env perl");
#endif
table[0][0] = "DS-ROOT";
@@ -840,7 +829,7 @@
s_root, FILE_PATHSEP, FILE_PATHSEP,
FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP);
#else
- strcpy(myperl, "!/usr/bin/env perl");
+ strcpy(myperl, "!/usr/bin/env perl");
#endif
table[0][0] = "DS-ROOT";
@@ -1083,8 +1072,8 @@
char subdir[PATH_SIZE];
/* Create slapd-nickname directory */
- PR_snprintf(subdir, sizeof(subdir), "%s%c"PRODUCT_NAME"-%s", sroot, FILE_PATHSEP,
- cf->servid);
+ PR_snprintf(subdir, sizeof(subdir), "%s%c"PRODUCT_NAME"-%s",
+ sroot, FILE_PATHSEP, cf->servid);
#ifdef XP_UNIX
/* Start/stop/rotate/restart scripts */
if (getenv("USE_DEBUGGER"))
@@ -1092,17 +1081,17 @@
char *debugger = getenv("DSINST_DEBUGGER");
char *debugger_command = getenv("DSINST_DEBUGGER_CMD");
if (! debugger) {
- debugger = "/tools/ns/workshop/bin/dbx";
+ debugger = "gdb";
}
if (! debugger_command) {
debugger_command = "echo"; /* e.g. do nothing */
}
#ifdef OSF1
- printf("-D %s -i %s/logs/pid -d %s -z\n", subdir, subdir,
+ printf("-D %s -i %s/pid -d %s -z\n", cf->config_dir, cf->run_dir,
cf->loglevel ? cf->loglevel : "0");
- t = gen_script(subdir, START_SCRIPT,
+ t = gen_script(cf->inst_dir, START_SCRIPT,
"\n"
- "# Script that starts the ns-slapd server.\n"
+ "# Script that starts the %s.\n"
"# Exit status can be:\n"
"# 0: Server started successfully\n"
"# 1: Server could not be started\n"
@@ -1110,17 +1099,19 @@
"\n"
"NETSITE_ROOT=%s\n"
"export NETSITE_ROOT\n"
- "PIDFILE=%s/logs/pid\n"
+ "%s=%s\n"
+ "export %s\n"
+ "PIDFILE=%s/pid\n"
"if test -f $PIDFILE ; then\n"
" PID=`cat $PIDFILE`\n"
" if kill -0 $PID > /dev/null 2>&1 ; then\n"
- " echo There is an ns-slapd process already running: $PID\n"
+ " echo There is an %s process already running: $PID\n"
" exit 2;\n"
" else\n"
" rm -f $PIDFILE\n"
" fi\n"
"fi\n"
- "cd %s/bin/%s/server; ./%s -D %s -i %s/logs/pid -d %s -z \"$@\" &\n"
+ "cd %s; ./%s -D %s -i %s/pid -d %s -z \"$@\" &\n"
"loop_counter=1\n"
"max_count=120\n"
"while test $loop_counter -le $max_count; do\n"
@@ -1129,19 +1120,21 @@
" sleep 1;\n"
" else\n"
" PID=`cat $PIDFILE`\n"
- /* rbyrne: setuputil takes any message here as an error:
- " echo Server has been started. ns-slapd process started: $PID\n"*/
+ /* rbyrne: setuputil takes any message here as an error:
+ " echo Server has been started. ns-slapd process started: $PID\n"*/
" exit 0;\n"
" fi\n"
"done\n"
"echo Server not running!! Failed to start ns-slapd process.\n"
"exit 1\n",
- sroot, subdir, sroot, PRODUCT_NAME, PRODUCT_BIN, subdir,
- subdir,
- cf->loglevel ? cf->loglevel : "0"
+ PRODUCT_BIN,
+ sroot, DS_CONFIG_DIR, cf->config_dir, DS_CONFIG_DIR, cf->run_dir,
+ PRODUCT_BIN,
+ sroot, PRODUCT_BIN, cf->config_dir, cf->run_dir,
+ cf->loglevel ? cf->loglevel : "0"
);
#else
- t = gen_script(subdir, START_SCRIPT,
+ t = gen_script(cf->inst_dir, START_SCRIPT,
"\n"
"# Script that starts the ns-slapd server.\n"
"# Exit status can be:\n"
@@ -1151,7 +1144,9 @@
"\n"
"NETSITE_ROOT=%s\n"
"export NETSITE_ROOT\n"
- "PIDFILE=%s/logs/pid\n"
+ "%s=%s\n"
+ "export %s\n"
+ "PIDFILE=%s/pid\n"
"if test -f $PIDFILE ; then\n"
" PID=`cat $PIDFILE`\n"
" if kill -0 $PID > /dev/null 2>&1 ; then\n"
@@ -1161,12 +1156,12 @@
" rm -f $PIDFILE\n"
" fi\n"
"fi\n"
- "if [ -x /usr/local/bin/xterm ]; then\n"
- " xterm=/usr/local/bin/xterm\n"
+ "if [ -x /usr/bin/xterm ]; then\n"
+ " xterm=/usr/bin/xterm\n"
"else\n"
" xterm=/usr/openwin/bin/xterm\n"
"fi\n"
- "cd %s/bin/%s/server; $xterm -title debugger -e %s -c \"dbxenv follow_fork_mode child ; stop in main ; %s ; run -D %s -i %s/logs/pid -d %s -z $*\" %s &\n"
+ "cd %s; $xterm -title debugger -e %s -c \"dbxenv follow_fork_mode child ; break main ; %s ; run -D %s -i %s/pid -d %s -z $*\" %s &\n"
"loop_counter=1\n"
"max_count=120\n"
"while test $loop_counter -le $max_count; do\n"
@@ -1182,15 +1177,15 @@
"done\n"
"echo Server not running!! Failed to start ns-slapd process.\n"
"exit 1\n",
- sroot, subdir, sroot, PRODUCT_NAME, debugger, debugger_command,
- subdir,
- subdir, cf->loglevel ? cf->loglevel : "0", PRODUCT_BIN
+ sroot, DS_CONFIG_DIR, cf->config_dir, DS_CONFIG_DIR, cf->run_dir,
+ sroot, debugger, debugger_command, cf->config_dir, cf->run_dir,
+ cf->loglevel ? cf->loglevel : "0", PRODUCT_BIN
);
#endif
}
else
{
- t = gen_script(subdir, START_SCRIPT,
+ t = gen_script(cf->inst_dir, START_SCRIPT,
"\n"
"# Script that starts the ns-slapd server.\n"
"# Exit status can be:\n"
@@ -1200,12 +1195,14 @@
"\n"
"NETSITE_ROOT=%s\n"
"export NETSITE_ROOT\n"
- "PIDFILE=%s/logs/pid\n"
- "STARTPIDFILE=%s/logs/startpid\n"
+ "%s=%s\n"
+ "export %s\n"
+ "PIDFILE=%s/pid\n"
+ "STARTPIDFILE=%s/startpid\n"
"if test -f $STARTPIDFILE ; then\n"
" PID=`cat $STARTPIDFILE`\n"
" if kill -0 $PID > /dev/null 2>&1 ; then\n"
- " echo There is an ns-slapd process already running: $PID\n"
+ " echo There is an %s process already running: $PID\n"
" exit 2;\n"
" else\n"
" rm -f $STARTPIDFILE\n"
@@ -1214,13 +1211,17 @@
"if test -f $PIDFILE ; then\n"
" PID=`cat $PIDFILE`\n"
" if kill -0 $PID > /dev/null 2>&1 ; then\n"
- " echo There is an ns-slapd process already running: $PID\n"
+ " echo There is an %s running: $PID\n"
" exit 2;\n"
" else\n"
" rm -f $PIDFILE\n"
" fi\n"
"fi\n"
- "cd %s/bin/%s/server; ./%s -D %s -i %s/logs/pid -w $STARTPIDFILE \"$@\"\n"
+#if 0
+ "cd %s; ./%s -D %s -i %s/pid -w $STARTPIDFILE \"$@\"\n"
+#else /* will go away */
+ "cd %s/bin/slapd/server; ./%s -D %s -i %s/pid -w $STARTPIDFILE \"$@\"\n"
+#endif
"if [ $? -ne 0 ]; then\n"
" exit 1\n"
"fi\n"
@@ -1261,13 +1262,14 @@
"done\n"
"echo Server not running!! Failed to start ns-slapd process. Please check the errors log for problems.\n"
"exit 1\n",
- sroot, subdir, subdir, sroot, PRODUCT_NAME, PRODUCT_BIN, subdir,
- subdir
+ sroot, DS_CONFIG_DIR, cf->config_dir, DS_CONFIG_DIR, cf->run_dir,
+ cf->run_dir, PRODUCT_BIN, PRODUCT_BIN,
+ sroot, PRODUCT_BIN, cf->config_dir, cf->run_dir
);
}
if(t) return t;
- t = gen_script(subdir, STOP_SCRIPT,
+ t = gen_script(cf->inst_dir, STOP_SCRIPT,
"\n"
"# Script that stops the ns-slapd server.\n"
"# Exit status can be:\n"
@@ -1275,7 +1277,7 @@
"# 1: Server could not be stopped\n"
"# 2: Server was not running\n"
"\n"
- "PIDFILE=%s/logs/pid\n"
+ "PIDFILE=%s/pid\n"
"if test ! -f $PIDFILE ; then\n"
" echo No ns-slapd PID file found. Server is probably not running\n"
" exit 2\n"
@@ -1302,8 +1304,8 @@
" if test -f $PIDFILE ; then\n"
" rm -f $PIDFILE\n"
" fi\n"
- /* rbyrne: setuputil takes any message here as an error:
- " echo Server has been stopped. ns-slapd process stopped: $PID\n"*/
+ /* rbyrne: setuputil takes any message here as an error:
+ " echo Server has been stopped. ns-slapd process stopped: $PID\n"*/
" exit 0\n"
" fi\n"
"done\n"
@@ -1311,10 +1313,10 @@
" echo Server still running!! Failed to stop the ns-slapd process: $PID. Please check the errors log for problems.\n"
"fi\n"
"exit 1\n",
- subdir);
+ cf->run_dir);
if(t) return t;
- t = gen_script(subdir, RESTART_SCRIPT,
+ t = gen_script(cf->inst_dir, RESTART_SCRIPT,
"\n"
"# Script that restarts the ns-slapd server.\n"
"# Exit status can be:\n"
@@ -1339,17 +1341,9 @@
" exit 2;\n"
"fi\n"
"exit $status\n",
- subdir, subdir );
+ cf->inst_dir, cf->inst_dir );
if(t) return t;
- /* logs subdir owned by server user */
- if( (t = chownlogs(subdir, cf->servuser)) )
- return t;
-
- /* config subdir owned by server user */
- if( (t = chownconfig(subdir, cf->servuser)) )
- return t;
-
#else /* XP_WIN32 */
/* Windows platforms have some extra setup */
if( (t = setup_ntserver(cf)) )
@@ -1376,7 +1370,7 @@
int update_server(server_config_s *cf)
{
char *t;
- char error_param[BIG_LINE] = {0};
+ char error_param[BIG_LINE] = {0};
#if defined( SOLARIS )
/*
@@ -1409,31 +1403,35 @@
out:
if(t)
- {
- char *msg;
- if (error_param[0])
- {
- msg = PR_smprintf("%s.error:could not update server %s - %s",
- error_param, cf->servid, t);
- }
- else
- {
- msg = PR_smprintf("error:could not update server %s - %s",
- cf->servid, t);
- }
- ds_show_message(msg);
- PR_smprintf_free(msg);
- return 1;
- }
- else
- return 0;
+ {
+ char *msg;
+ if (error_param[0])
+ {
+ msg = PR_smprintf("%s.error:could not update server %s - %s",
+ error_param, cf->servid, t);
+ }
+ else
+ {
+ msg = PR_smprintf("error:could not update server %s - %s",
+ cf->servid, t);
+ }
+ ds_show_message(msg);
+ PR_smprintf_free(msg);
+ return 1;
+ }
+ else
+ return 0;
}
/* ---------------------- Create configuration files ---------------------- */
char *create_server(server_config_s *cf, char *param_name)
{
- char line[PATH_SIZE], *t, *sroot = cf->sroot;
+#if 0
+ char line[PATH_SIZE]
char subdir[PATH_SIZE];
+#endif
+ char *t, *sroot = cf->sroot;
+ struct passwd *pw = getpwnam(cf->servuser);
#if defined( SOLARIS )
/*
@@ -1462,39 +1460,49 @@
if( (t = sanity_check(cf, param_name)) )
return t;
- /* Create slapd-nickname directory */
- PR_snprintf(subdir, sizeof(subdir), "%s%c"PRODUCT_NAME"-%s", sroot, FILE_PATHSEP,
- cf->servid);
- if( (create_instance_mkdir(subdir, NEWDIR_MODE)) )
- return make_error("mkdir %s failed (%s)", subdir, ds_system_errmsg());
+ /* Create slapd-nickname directory (instance directory) */
+ if( (create_instance_mkdir_p("inst dir", cf->inst_dir, NEWDIR_MODE, pw)) )
+ return make_error("make inst dir %s failed (%s)",
+ cf->inst_dir, ds_system_errmsg());
- /* Create slapd-nickname/config directory */
- PR_snprintf(line, sizeof(line), "%s%cconfig", subdir, FILE_PATHSEP);
- if( (create_instance_mkdir(line, NEWDIR_MODE)) )
- return make_error("mkdir %s failed (%s)", line, ds_system_errmsg());
-
- /* Create slapd-nickname/config/schema directory */
- PR_snprintf(line, sizeof(line), "%s%cconfig%cschema", subdir, FILE_PATHSEP, FILE_PATHSEP);
- if( (create_instance_mkdir(line, NEWDIR_MODE)) )
- return make_error("mkdir %s failed (%s)", line, ds_system_errmsg());
+ /* Create config directory */
+ if( (create_instance_mkdir_p("config dir", cf->config_dir, NEWDIR_MODE, pw)) )
+ return make_error("make config dir %s failed (%s)",
+ cf->config_dir, ds_system_errmsg());
+
+ /* Create config_dir/schema directory */
+ if( (create_instance_mkdir_p("schema dir", cf->schema_dir, NEWDIR_MODE, pw)) )
+ return make_error("make schema dir %s failed (%s)",
+ cf->schema_dir, ds_system_errmsg());
#if defined (BUILD_PRESENCE)
- /* Create slapd-nickname/config/presence directory */
- PR_snprintf(line, sizeof(line), "%s%cconfig%cpresence", subdir, FILE_PATHSEP, FILE_PATHSEP);
+ /* Create config_dir/presence directory */
+ PR_snprintf(line, sizeof(line), "%s%cpresence",
+ cf->config_dir, FILE_PATHSEP);
if( (create_instance_mkdir(line, NEWDIR_MODE)) )
return make_error("mkdir %s failed (%s)", line, ds_system_errmsg());
#endif
- /* Create slapd-nickname/logs directory */
- PR_snprintf(line, sizeof(line), "%s%clogs", subdir, FILE_PATHSEP);
- if( (create_instance_mkdir(line, NEWSECDIR_MODE)) )
- return make_error("mkdir %s failed (%s)", line, ds_system_errmsg());
-
+ /* Create log directory */
+ if( (create_instance_mkdir_p("log dir", cf->log_dir, NEWSECDIR_MODE, pw)) )
+ return make_error("make log dir %s failed (%s)",
+ cf->log_dir, ds_system_errmsg());
+
+ /* Create lock directory */
+ if( (create_instance_mkdir_p("lock dir", cf->lock_dir, NEWSECDIR_MODE, pw)) )
+ return make_error("make lock dir %s failed (%s)",
+ cf->lock_dir, ds_system_errmsg());
+
+ /* Create run directory */
+ if( (create_instance_mkdir_p("run dir", cf->run_dir, NEWSECDIR_MODE, pw)) )
+ return make_error("make run dir %s failed (%s)",
+ cf->run_dir, ds_system_errmsg());
+# if 0
/* Create httpacl directory */
PR_snprintf(line, sizeof(line), "%s%chttpacl", cf->sroot, FILE_PATHSEP);
if( (create_instance_mkdir(line, NEWDIR_MODE)) )
return make_error("mkdir %s failed (%s)", line, ds_system_errmsg());
-
+#endif
t = create_scripts(cf, param_name);
if(t) return t;
@@ -1514,12 +1522,8 @@
return NULL;
}
-
-
-
/* ------------------------- Copied from libadmin ------------------------- */
-
/*
These replace the versions in libadmin to allow error returns.
@@ -1528,20 +1532,53 @@
*/
-int create_instance_exists(char *fn)
+/*
+ * input:
+ * fn: file/dir name
+ * type:
+ * if you don't care of the file type, 0
+ * if file, PR_FILE_FILE
+ * if directory, PR_FILE_DIRECTORY
+ * else, PR_FILE_OTHER
+ *
+ * return value:
+ * 0: does not exist
+ * 1: exists
+ * -1: exists, but unexpected type
+ */
+int
+create_instance_exists(char *fn, int type)
{
- struct stat finfo;
+ PRFileInfo finfo;
- if(stat(fn, &finfo) < 0)
- return 0;
- else
- return 1;
+ if(PR_GetFileInfo(fn, &finfo) == PR_FAILURE)
+ return 0; /* does not exist */
+ else {
+ if (type > 0) {
+ if (type == finfo.type) {
+ return 1;
+ } else {
+ return -1;
+ }
+ } else {
+ return 1;
+ }
+ }
}
-int create_instance_mkdir(char *dir, int mode)
+int
+create_instance_mkdir(char *dir, int mode)
{
- if(!create_instance_exists(dir)) {
+ int rv = 0;
+ if (NULL == dir)
+ return -1;
+ rv = create_instance_exists(dir, PR_FILE_DIRECTORY);
+ if (rv < 0) { /* not a directory */
+ PR_Delete(dir);
+ rv = 0;
+ }
+ if(0 == rv) { /* dir does not exist */
#ifdef XP_UNIX
if(mkdir(dir, mode) == -1)
#else /* XP_WIN32 */
@@ -1553,12 +1590,18 @@
}
-char *create_instance_mkdir_p(char *dir, int mode)
+char *create_instance_mkdir_p(char *str, char *dir, int mode, struct passwd *pw)
{
static char errmsg[ERR_SIZE];
struct stat fi;
char *t;
+ if (NULL == dir) {
+ PR_snprintf(errmsg, sizeof(errmsg), "NULL is passed to make \"%s\"",
+ str?str:"unknown");
+ return errmsg;
+ }
+
#ifdef XP_UNIX
t = dir + 1;
#else /* XP_WIN32 */
@@ -1571,9 +1614,11 @@
if(t) *t = '\0';
if(stat(dir, &fi) == -1) {
if(create_instance_mkdir(dir, mode) == -1) {
- PR_snprintf(errmsg, sizeof(errmsg), "mkdir %s failed (%s)", dir, ds_system_errmsg());
+ PR_snprintf(errmsg, sizeof(errmsg), "mkdir %s for \"%s\" failed (%s)", dir, str, ds_system_errmsg());
return errmsg;
}
+ if (pw)
+ chownfile(pw, dir);
}
if(t)
{
@@ -1892,7 +1937,7 @@
if(is_a_dir(src_dir, d->name)) {
char *sub_src_dir = strdup(src_file);
char *sub_dest_dir = strdup(dest_file);
- if( (t = create_instance_mkdir_p(sub_dest_dir, NEWDIR_MODE)) )
+ if( (t = create_instance_mkdir_p(sub_dest_dir, sub_dest_dir, NEWDIR_MODE, NULL)) )
return(t);
if( (t = ds_copy_group_files_using_mode(sub_src_dir, sub_dest_dir, filter, use_mode)) )
return t;
@@ -1949,54 +1994,49 @@
/* ------------- Create config files for Directory Server -------------- */
-char *ds_cre_subdirs(char *sroot, server_config_s *cf, char *cs_path,
- struct passwd* pw)
+static char *
+ds_cre_subdirs(server_config_s *cf, struct passwd* pw)
{
char subdir[PATH_SIZE], *t = NULL;
- /* create subdir /db */
- PR_snprintf(subdir, sizeof(subdir), "%s%cdb", cs_path, FILE_PATHSEP);
- if( (t = create_instance_mkdir_p(subdir, NEWDIR_MODE)) )
+ /* create db dir */
+ if( (t = create_instance_mkdir_p("db dir", cf->db_dir, NEWDIR_MODE, pw)) )
return(t);
- chownfile (pw, subdir);
- /* create subdir /ldif */
- PR_snprintf(subdir, sizeof(subdir), "%s%cldif", cs_path, FILE_PATHSEP);
- if( (t = create_instance_mkdir_p(subdir, NEWDIR_MODE)) )
+ /* create ldif dir */
+ if( (t = create_instance_mkdir_p("ldif dir", cf->ldif_dir, NEWDIR_MODE, pw)) )
return(t);
- chownfile (pw, subdir);
+#ifdef DSML
/* create subdir /dsml */
PR_snprintf(subdir, sizeof(subdir), "%s%cdsml", cs_path, FILE_PATHSEP);
- if( (t = create_instance_mkdir_p(subdir, NEWDIR_MODE)) )
+ if( (t = create_instance_mkdir_p("dsml dir", subdir, NEWDIR_MODE, pw)) )
return(t);
- chownfile (pw, subdir);
-
- /* create subdir /bak */
- PR_snprintf(subdir, sizeof(subdir), "%s%cbak", cs_path, FILE_PATHSEP);
- if( (t = create_instance_mkdir_p(subdir, NEWDIR_MODE)) )
+#endif
+ /* create bak dir */
+ if( (t = create_instance_mkdir_p("backup dir", cf->bak_dir, NEWDIR_MODE, pw)) )
return(t);
- chownfile (pw, subdir);
/* Create slapd-nickname/confbak directory */
- PR_snprintf(subdir, sizeof(subdir), "%s%cconfbak", cs_path, FILE_PATHSEP);
- if( (t=create_instance_mkdir_p(subdir, NEWDIR_MODE)) )
+ PR_snprintf(subdir, sizeof(subdir), "%s%cconfbak", cf->config_dir, FILE_PATHSEP);
+ if( (t=create_instance_mkdir_p("config bak dir", subdir, NEWDIR_MODE, pw)) )
return(t);
- chownfile (pw, subdir);
+#ifdef DSGW
/* create subdir /dsgw/context */
PR_snprintf(subdir, sizeof(subdir), "%s%cclients", sroot, FILE_PATHSEP);
if (is_a_dir(subdir, "dsgw")) { /* only create dsgw stuff if we are installing it */
PR_snprintf(subdir, sizeof(subdir), "%s%cclients%cdsgw%ccontext", sroot, FILE_PATHSEP,FILE_PATHSEP,FILE_PATHSEP);
- if( (t = create_instance_mkdir_p(subdir, NEWDIR_MODE)) )
+ if( (t = create_instance_mkdir_p("dsgw context dir", subdir, NEWDIR_MODE, pw)) )
return(t);
}
/* create subdir /bin/slapd/authck */
+ /* dsgw cookie dir */
PR_snprintf(subdir, sizeof(subdir), "%s%cbin%cslapd%cauthck", sroot, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP);
- if( (t = create_instance_mkdir_p(subdir, NEWDIR_MODE)) )
+ if( (t = create_instance_mkdir_p("authck dir", subdir, NEWDIR_MODE, pw)) )
return(t);
- chownfile (pw, subdir);
+#endif
return (t);
}
@@ -2019,8 +2059,9 @@
#define CREATE_VERIFYDB() \
gen_perl_script_auto(mysroot, mycs_path, "verify-db.pl", cf)
+/* tentatively moved to mycs_path */
#define CREATE_REPL_MONITOR_CGI() \
- gen_perl_script_auto(mysroot, cgics_path, "repl-monitor-cgi.pl", cf)
+ gen_perl_script_auto(mysroot, mycs_path, "repl-monitor-cgi.pl", cf)
#define CREATE_ACCOUNT_INACT(_commandName) \
gen_perl_script_auto(mysroot, cs_path, _commandName, cf)
@@ -2065,7 +2106,15 @@
char *ds_gen_scripts(char *sroot, server_config_s *cf, char *cs_path)
{
char *t = NULL;
- char server[PATH_SIZE], admin[PATH_SIZE], tools[PATH_SIZE];
+#if 0
+ char *server = sroot;
+ char *admin = sroot;
+ char *tools = cf->bindir;
+#else
+ char server[PATH_SIZE];
+ char admin[PATH_SIZE];
+ char tools[PATH_SIZE];
+#endif
char cgics_path[PATH_SIZE];
char *cl_scripts[7] = {"dsstop", "dsstart", "dsrestart", "dsrestore", "dsbackup", "dsimport", "dsexport"};
char *cl_javafiles[7] = {"DSStop", "DSStart", "DSRestart", "DSRestore", "DSBackup", "DSImport", "DSExport"};
@@ -2082,12 +2131,16 @@
mysroot = sroot;
mycs_path = cs_path;
- PR_snprintf(server, sizeof(server), "%s/bin/"PRODUCT_NAME"/server", sroot);
- PR_snprintf(admin, sizeof(admin), "%s/bin/"PRODUCT_NAME"/admin/bin", sroot);
- PR_snprintf(tools, sizeof(tools), "%s/shared/bin", sroot);
+#if 0
+ /* nothing to do for server, admin, tools */
PR_snprintf(cgics_path, sizeof(cgics_path), "%s%cbin%cadmin%cadmin%cbin", sroot,
FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP);
+#else /* will go away */
+ PR_snprintf(server, sizeof(server), "%s/bin/"PRODUCT_NAME"/server", sroot);
+ PR_snprintf(admin, sizeof(admin), "%s/bin/"PRODUCT_NAME"/admin/bin", sroot);
+ PR_snprintf(tools, sizeof(tools), "%s/shared/bin", sroot);
+#endif
t = gen_script(cs_path, "monitor",
"if [ \"x$1\" != \"x\" ];\nthen MDN=\"$1\";\nelse MDN=\"cn=monitor\";\n fi\n"
@@ -2100,14 +2153,14 @@
"cd %s\n"
"echo saving configuration ...\n"
"conf_ldif=%s/confbak/`date +%%Y_%%m_%%d_%%H%%M%%S`.ldif\n"
- "./ns-slapd db2ldif -N -D %s "
+ "./%s db2ldif -N -D %s "
"-s \"%s\" -a $conf_ldif -n NetscapeRoot 2>&1\n"
"if [ \"$?\" -ge 1 ] \nthen\n"
" echo Error occurred while saving configuration\n"
" exit 1\n"
"fi\n"
"exit 0\n",
- server, cs_path, cs_path, cf->netscaperoot);
+ server, cf->config_dir, PRODUCT_BIN, cf->config_dir, cf->netscaperoot);
if(t) return t;
t = gen_script(cs_path, "restoreconfig",
@@ -2118,10 +2171,10 @@
" echo No configuration to restore in %s/confbak ; exit 1\n"
"fi\n"
"echo Restoring $conf_ldif\n"
- "./ns-slapd ldif2db -D %s"
+ "./%s ldif2db -D %s"
" -i $conf_ldif -n NetscapeRoot 2>&1\n"
"exit $?\n",
- server, cs_path, cs_path, cs_path);
+ server, cf->config_dir, cf->config_dir, PRODUCT_BIN, cf->config_dir);
if(t) return t;
t = gen_script(cs_path, "ldif2db",
@@ -2133,9 +2186,9 @@
"\texit 1\n"
"fi\n\n"
"echo importing data ...\n"
- "./ns-slapd ldif2db -D %s \"$@\" 2>&1\n"
+ "./%s ldif2db -D %s \"$@\" 2>&1\n"
"exit $?\n",
- server, cs_path);
+ server, PRODUCT_BIN, cf->config_dir);
if(t) return t;
#if defined(UPGRADEDB)
@@ -2143,14 +2196,15 @@
"cd %s\n"
"if [ \"$#\" -eq 1 ]\nthen\n"
"\tbak_dir=$1\nelse\n"
- "\tbak_dir=%s/bak/upgradedb_`date +%%Y_%%m_%%d_%%H_%%M_%%S`\nfi\n\n"
+ "\tbak_dir=%s/upgradedb_`date +%%Y_%%m_%%d_%%H_%%M_%%S`\nfi\n\n"
"echo upgrade index files ...\n"
- "./ns-slapd upgradedb -D %s -a $bak_dir\n",
- server, cs_path, cs_path);
+ "./%s upgradedb -D %s -a $bak_dir\n",
+ server, cf->bak_dir, PRODUCT_BIN, cf->config_dir);
if(t) return t;
#endif
/* new code for dsml import */
+ /* OBSOLETE??? */
t = gen_script(cs_path, "dsml2db",
"cd %s\n"
"if [ $# -lt 4 ]\nthen\n"
@@ -2250,7 +2304,7 @@
"\texit 1\n"
"fi\n\n"
"pwdhash -D %s -H -s \"$@\"\n",
- server, server, cs_path);
+ server, cf->config_dir, cs_path);
if(t) return t;
t = gen_script(cs_path, "db2ldif",
@@ -2275,9 +2329,11 @@
"if [ $ldif_file = \"mydummy\" ]\nthen\n"
"\tldif_file=%s/ldif/`date +%%Y_%%m_%%d_%%H%%M%%S`.ldif\nfi\n"
"if [ $set_ldif -eq 2 ]\nthen\n"
- "./ns-slapd db2ldif -D %s \"$@\"\nelse\n"
- "./ns-slapd db2ldif -D %s -a $ldif_file \"$@\"\nfi\n",
- server, cs_path, cs_path, cs_path);
+ "./%s db2ldif -D %s \"$@\"\nelse\n"
+ "./%s db2ldif -D %s -a $ldif_file \"$@\"\nfi\n",
+ server, cf->ldif_dir,
+ PRODUCT_BIN, cf->config_dir,
+ PRODUCT_BIN, cf->config_dir);
if(t) return t;
/* new code for dsml export */
@@ -2324,15 +2380,17 @@
"if [ $# -eq 0 ]\n"
"then\n"
"\tbak_dir=%s/bak/reindex_`date +%%Y_%%m_%%d_%%H_%%M_%%S`\n"
- "\t./ns-slapd upgradedb -D %s -f -a \"$bak_dir\"\n"
+ "\t./%s upgradedb -D %s -f -a \"$bak_dir\"\n"
"elif [ $# -lt 4 ]\n"
"then\n"
"\techo \"Usage: db2index [-n backend_instance | {-s includesuffix}* -t attribute[:indextypes[:matchingrules]] -T vlvattribute]\"\n"
"\texit 1\n"
"else\n"
- "\t./ns-slapd db2index -D %s \"$@\"\n"
+ "\t./%s db2index -D %s \"$@\"\n"
"fi\n\n",
- server, cs_path, cs_path, cs_path);
+ server, cf->ldif_dir,
+ PRODUCT_BIN, cf->config_dir,
+ PRODUCT_BIN, cf->config_dir);
if(t) return t;
#endif
@@ -2344,17 +2402,17 @@
"\techo Note: either \\\"-n backend_instance\\\" or \\\"-s includesuffix\\\" are required.\n"
"\texit 1\n"
"fi\n\n"
- "./ns-slapd db2index -D %s \"$@\"\n",
- server, cs_path);
+ "./%s db2index -D %s \"$@\"\n",
+ server, PRODUCT_BIN, cf->config_dir);
if(t) return t;
t = gen_script(cs_path, "db2bak",
"cd %s\n"
"if [ \"$#\" -eq 1 ]\nthen\n"
"\tbak_dir=$1\nelse\n"
- "\tbak_dir=%s/bak/`date +%%Y_%%m_%%d_%%H_%%M_%%S`\nfi\n\n"
- "./ns-slapd db2archive -D %s -a $bak_dir\n",
- server, cs_path, cs_path);
+ "\tbak_dir=%s/`date +%%Y_%%m_%%d_%%H_%%M_%%S`\nfi\n\n"
+ "./%s db2archive -D %s -a $bak_dir\n",
+ server, cf->bak_dir, PRODUCT_BIN, cf->config_dir);
if(t) return t;
t = CREATE_DB2BAK();
@@ -2365,14 +2423,14 @@
" echo \"Usage: bak2db archivedir [-n backendname]\"\n"
" exit 1\n"
"else\n"
- " archivedir=$1\n"
- " shift\n"
+ " archivedir=$1\n"
+ " shift\n"
"fi\n"
"while getopts \"n:\" flag\ndo\n"
- " case $flag in\n"
- " n) bename=$OPTARG;;\n"
- " *) echo \"Usage: bak2db archivedir [-n backendname]\"; exit 2;;\n"
- " esac\n"
+ " case $flag in\n"
+ " n) bename=$OPTARG;;\n"
+ " *) echo \"Usage: bak2db archivedir [-n backendname]\"; exit 2;;\n"
+ " esac\n"
"done\n\n"
"if [ 1 = `expr $archivedir : \"\\/\"` ]\nthen\n"
" archivedir=$archivedir\n"
@@ -2381,11 +2439,11 @@
" archivedir=`pwd`/$archivedir\nfi\n\n"
"cd %s\n"
"if [ \"$#\" -eq 2 ]\nthen\n"
- " ./ns-slapd archive2db -D %s -a $archivedir -n $bename\n"
+ " ./%s archive2db -D %s -a $archivedir -n $bename\n"
"else\n"
- " ./ns-slapd archive2db -D %s -a $archivedir\n"
+ " ./%s archive2db -D %s -a $archivedir\n"
"fi\n",
- server, cs_path, cs_path);
+ server, PRODUCT_BIN, cf->config_dir, PRODUCT_BIN, cf->config_dir);
if(t) return t;
t = CREATE_BAK2DB();
@@ -2419,8 +2477,8 @@
"\techo Usage: suffix2instance {-s includesuffix}*\n"
"\texit 1\n"
"fi\n\n"
- "./ns-slapd suffix2instance -D %s \"$@\" 2>&1\n",
- server, cs_path);
+ "./%s suffix2instance -D %s \"$@\" 2>&1\n",
+ server, PRODUCT_BIN, cf->config_dir);
if(t) return t;
/*Generate the java commandline tools in bin/slapd/server*/
@@ -2450,11 +2508,10 @@
if(t) return t;
}
-
-
return (t);
}
#else
+/* Windows; haven't updated */
char *ds_gen_scripts(char *sroot, server_config_s *cf, char *cs_path)
{
char *t = NULL;
@@ -3146,7 +3203,7 @@
belowdn = PR_smprintf("cn=index,cn=%s,cn=ldbm database,cn=plugins,cn=config", be_name);
ds_gen_index(f, belowdn);
- PR_smprintf_free(belowdn);
+ PR_smprintf_free(belowdn);
/* done with ldbm entries */
}
@@ -3164,8 +3221,7 @@
fprintf(f, "\n"); \
} while (0)
-char *ds_gen_confs(char *sroot, server_config_s *cf,
- char *cs_path)
+char *ds_gen_confs(char *sroot, server_config_s *cf, char *cs_path)
{
char* t = NULL;
char src[PATH_SIZE], dest[PATH_SIZE];
@@ -3173,10 +3229,13 @@
FILE *f = 0, *srcf = 0;
int rootdse = 0;
char *shared_lib;
+ struct passwd *pw = getpwnam(cf->servuser);
- PR_snprintf(fn, sizeof(fn), "%s%cconfig%cdse.ldif", cs_path, FILE_PATHSEP, FILE_PATHSEP);
+ PR_snprintf(fn, sizeof(fn), "%s%c%s",
+ cf->config_dir, FILE_PATHSEP, DS_CONFIG_FILE);
if(!(f = fopen(fn, "w")))
- return make_error("Can't write to %s (%s)", fn, ds_system_errmsg());
+ return make_error("Can't write to %s (%s)",
+ cf->config_dir, ds_system_errmsg());
#if defined( XP_WIN32 )
shared_lib = ".dll";
@@ -3205,6 +3264,9 @@
fprintf(f, "objectclass:top\n");
fprintf(f, "objectclass:extensibleObject\n");
fprintf(f, "objectclass:nsslapdConfig\n");
+ fprintf(f, "nsslapd-instancedir: %s\n", cf->inst_dir);
+ fprintf(f, "nsslapd-schemadir: %s\n", cf->schema_dir);
+ fprintf(f, "nsslapd-ldifdir: %s\n", cf->ldif_dir);
fprintf(f, "nsslapd-accesslog-logging-enabled: on\n");
fprintf(f, "nsslapd-accesslog-maxlogsperdir: 10\n");
fprintf(f, "nsslapd-accesslog-mode: 600\n");
@@ -3214,7 +3276,11 @@
fprintf(f, "nsslapd-accesslog-logrotationsync-enabled: off\n");
fprintf(f, "nsslapd-accesslog-logrotationsynchour: 0\n");
fprintf(f, "nsslapd-accesslog-logrotationsyncmin: 0\n");
+#if 0
+ fprintf(f, "nsslapd-accesslog: %s/access\n", cf->log_dir);
+#else /* will go away */
fprintf(f, "nsslapd-accesslog: %s/logs/access\n", cs_path);
+#endif
fprintf(f, "nsslapd-enquote-sup-oc: off\n");
fprintf(f, "nsslapd-localhost: %s\n", cf->servname);
fprintf(f, "nsslapd-schemacheck: %s\n",
@@ -3237,10 +3303,18 @@
fprintf(f, "nsslapd-errorlog-logrotationsync-enabled: off\n");
fprintf(f, "nsslapd-errorlog-logrotationsynchour: 0\n");
fprintf(f, "nsslapd-errorlog-logrotationsyncmin: 0\n");
+#if 0
+ fprintf(f, "nsslapd-errorlog: %s/errors\n", cf->log_dir);
+#else /* will go away */
fprintf(f, "nsslapd-errorlog: %s/logs/errors\n", cs_path);
+#endif
if (cf->loglevel)
fprintf(f, "nsslapd-errorlog-level: %s\n", cf->loglevel);
+#if 0
+ fprintf(f, "nsslapd-auditlog: %s/audit\n", cf->log_dir);
+#else /* will go away */
fprintf(f, "nsslapd-auditlog: %s/logs/audit\n", cs_path);
+#endif
fprintf(f, "nsslapd-auditlog-mode: 600\n");
fprintf(f, "nsslapd-auditlog-maxlogsize: 100\n");
fprintf(f, "nsslapd-auditlog-logrotationtime: 1\n");
@@ -3360,15 +3434,15 @@
fprintf(f, "\n");
#endif
- fprintf(f, "dn: cn=MD5,cn=Password Storage Schemes,cn=plugins,cn=config\n");
- fprintf(f, "objectclass: top\n");
- fprintf(f, "objectclass: nsSlapdPlugin\n");
- fprintf(f, "cn: MD5\n");
- fprintf(f, "nsslapd-pluginpath: %s/lib/pwdstorage-plugin%s\n", sroot, shared_lib);
- fprintf(f, "nsslapd-plugininitfunc: md5_pwd_storage_scheme_init\n");
- fprintf(f, "nsslapd-plugintype: pwdstoragescheme\n");
- fprintf(f, "nsslapd-pluginenabled: on\n");
- fprintf(f, "\n");
+ fprintf(f, "dn: cn=MD5,cn=Password Storage Schemes,cn=plugins,cn=config\n");
+ fprintf(f, "objectclass: top\n");
+ fprintf(f, "objectclass: nsSlapdPlugin\n");
+ fprintf(f, "cn: MD5\n");
+ fprintf(f, "nsslapd-pluginpath: %s/lib/pwdstorage-plugin%s\n", sroot, shared_lib);
+ fprintf(f, "nsslapd-plugininitfunc: md5_pwd_storage_scheme_init\n");
+ fprintf(f, "nsslapd-plugintype: pwdstoragescheme\n");
+ fprintf(f, "nsslapd-pluginenabled: on\n");
+ fprintf(f, "\n");
fprintf(f, "dn: cn=CLEAR,cn=Password Storage Schemes,cn=plugins,cn=config\n");
fprintf(f, "objectclass: top\n");
@@ -3635,7 +3709,7 @@
fprintf(f, "nsslapd-plugininitfunc: orderingRule_init\n");
fprintf(f, "nsslapd-plugintype: matchingRule\n");
fprintf(f, "nsslapd-pluginenabled: on\n");
- fprintf(f, "nsslapd-pluginarg0: %s/config/slapd-collations.conf\n", cs_path);
+ fprintf(f, "nsslapd-pluginarg0: %s/slapd-collations.conf\n", cf->config_dir);
fprintf(f, "\n");
/* The HTTP client plugin */
@@ -3767,29 +3841,29 @@
#ifdef BUILD_PAM_PASSTHRU
#if !defined( XP_WIN32 )
- /* PAM Pass Through Auth plugin - off by default */
- fprintf(f, "dn: cn=PAM Pass Through Auth,cn=plugins,cn=config\n");
- fprintf(f, "objectclass: top\n");
- fprintf(f, "objectclass: nsSlapdPlugin\n");
- fprintf(f, "objectclass: extensibleObject\n");
- fprintf(f, "objectclass: pamConfig\n");
- fprintf(f, "cn: PAM Pass Through Auth\n");
- fprintf(f, "nsslapd-pluginpath: %s/lib/pam-passthru-plugin%s\n", sroot, shared_lib);
- fprintf(f, "nsslapd-plugininitfunc: pam_passthruauth_init\n");
- fprintf(f, "nsslapd-plugintype: preoperation\n");
- fprintf(f, "nsslapd-pluginenabled: off\n");
- fprintf(f, "nsslapd-pluginLoadGlobal: true\n");
- fprintf(f, "nsslapd-plugin-depends-on-type: database\n");
- fprintf(f, "pamMissingSuffix: ALLOW\n");
- if (cf->netscaperoot) {
- fprintf(f, "pamExcludeSuffix: %s\n", cf->netscaperoot);
- }
- fprintf(f, "pamExcludeSuffix: cn=config\n");
- fprintf(f, "pamMapMethod: RDN\n");
- fprintf(f, "pamFallback: FALSE\n");
- fprintf(f, "pamSecure: TRUE\n");
- fprintf(f, "pamService: ldapserver\n");
- fprintf(f, "\n");
+ /* PAM Pass Through Auth plugin - off by default */
+ fprintf(f, "dn: cn=PAM Pass Through Auth,cn=plugins,cn=config\n");
+ fprintf(f, "objectclass: top\n");
+ fprintf(f, "objectclass: nsSlapdPlugin\n");
+ fprintf(f, "objectclass: extensibleObject\n");
+ fprintf(f, "objectclass: pamConfig\n");
+ fprintf(f, "cn: PAM Pass Through Auth\n");
+ fprintf(f, "nsslapd-pluginpath: %s/lib/pam-passthru-plugin%s\n", sroot, shared_lib);
+ fprintf(f, "nsslapd-plugininitfunc: pam_passthruauth_init\n");
+ fprintf(f, "nsslapd-plugintype: preoperation\n");
+ fprintf(f, "nsslapd-pluginenabled: off\n");
+ fprintf(f, "nsslapd-pluginLoadGlobal: true\n");
+ fprintf(f, "nsslapd-plugin-depends-on-type: database\n");
+ fprintf(f, "pamMissingSuffix: ALLOW\n");
+ if (cf->netscaperoot) {
+ fprintf(f, "pamExcludeSuffix: %s\n", cf->netscaperoot);
+ }
+ fprintf(f, "pamExcludeSuffix: cn=config\n");
+ fprintf(f, "pamMapMethod: RDN\n");
+ fprintf(f, "pamFallback: FALSE\n");
+ fprintf(f, "pamSecure: TRUE\n");
+ fprintf(f, "pamService: ldapserver\n");
+ fprintf(f, "\n");
#endif /* NO PAM FOR WINDOWS */
#endif /* BUILD_PAM_PASSTHRU */
@@ -3980,24 +4054,28 @@
fprintf(f, "\n");
/* create the changelog directory */
- if( (t = create_instance_mkdir_p(cf->changelogdir, NEWDIR_MODE)) )
+ if( (t = create_instance_mkdir_p("changelog dir", cf->changelogdir, NEWDIR_MODE, pw)) )
return(t);
}
fclose (f);
- PR_snprintf(src, sizeof(src), "%s%cconfig%cdse.ldif", cs_path, FILE_PATHSEP, FILE_PATHSEP);
- PR_snprintf(fn, sizeof(fn), "%s%cconfig%cdse_original.ldif", cs_path, FILE_PATHSEP, FILE_PATHSEP);
- create_instance_copy(src, fn, 0600);
-
- /*
- * generate slapd-collations.conf
- */
- PR_snprintf(src, sizeof(src), "%s%cbin%c"PRODUCT_NAME"%cinstall%cconfig%c%s-collations.conf",
- sroot, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP,
- FILE_PATHSEP, PRODUCT_NAME);
- PR_snprintf(dest, sizeof(dest), "%s%cconfig%c%s-collations.conf", cs_path, FILE_PATHSEP,
- FILE_PATHSEP, PRODUCT_NAME);
+ PR_snprintf(src, sizeof(src), "%s%cdse.ldif", cf->config_dir, FILE_PATHSEP);
+ PR_snprintf(dest, sizeof(dest), "%s%cdse_original.ldif", cf->config_dir, FILE_PATHSEP);
+ create_instance_copy(src, dest, 0600);
+
+ /* install certmap.conf at /BRAND_DS */
+ PR_snprintf(src, sizeof(src), "%s/bin/slapd/install/config/certmap.conf",
+ cf->sroot);
+ PR_snprintf(dest, sizeof(dest), "%s/certmap.conf", cf->config_dir);
+ create_instance_copy(src, dest, 0600);
+
+ /* generate /BRAND_DS/slapd-collations.conf */
+ PR_snprintf(src, sizeof(src),
+ "%s/bin/slapd/install/config/%s-collations.conf",
+ cf->sroot, PRODUCT_NAME);
+ PR_snprintf(dest, sizeof(dest), "%s%c%s-collations.conf",
+ cf->config_dir, FILE_PATHSEP, PRODUCT_NAME);
if (!(srcf = fopen(src, "r"))) {
return make_error("Can't read from %s (%s)", src, ds_system_errmsg());
}
@@ -4016,9 +4094,16 @@
fclose(srcf);
fclose(f);
+ /*
+ * /BRAND_DS/schema to schema_dir
+ */
+#if 0 /* going to be 1 !! */
+ PR_snprintf(src, sizeof(src), "%s%c%s%cschema",
+ cf->sysconfdir, FILE_PATHSEP, BRAND_DS, FILE_PATHSEP);
+#else
PR_snprintf(src, sizeof(src), "%s/bin/slapd/install/schema", sroot);
- PR_snprintf(dest, sizeof(dest), "%s/config/schema", cs_path);
- if (NULL != (t = ds_copy_group_files(src, dest, 0)))
+#endif
+ if (NULL != (t = ds_copy_group_files(src, cf->schema_dir, 0)))
return t;
#if defined (BUILD_PRESENCE)
@@ -4028,6 +4113,7 @@
return t;
#endif
+#if defined (ORGCHART)
/* Generate the orgchart configuration */
PR_snprintf(src, sizeof(src), "%s/clients", sroot);
if (is_a_dir(src, "orgchart")) {
@@ -4035,7 +4121,9 @@
return t;
}
}
+#endif
+#if defined (DSGW)
/* Generate dsgw.conf */
PR_snprintf(src, sizeof(src), "%s/clients", sroot);
if (is_a_dir(src, "dsgw")) {
@@ -4048,6 +4136,7 @@
return t;
}
}
+#endif
return NULL; /* Everything worked fine */
}
@@ -4088,9 +4177,8 @@
PR_snprintf(dest, sizeof(dest), "%s%cclients%cdsgw%ccontext%c%s.conf", sroot, FILE_PATHSEP,FILE_PATHSEP,
FILE_PATHSEP, FILE_PATHSEP, ctxt);
-
/* If the config file already exists, just return success */
- if (create_instance_exists(dest)) {
+ if (create_instance_exists(dest, PR_FILE_FILE)) {
return(NULL);
}
@@ -4205,7 +4293,7 @@
FILE_PATHSEP, FILE_PATHSEP);
/* If the config file already exists, just return success */
- if (create_instance_exists(dest)) {
+ if (create_instance_exists(dest, PR_FILE_FILE)) {
return(NULL);
}
@@ -4382,13 +4470,13 @@
ds_gen_index(FILE* f, char* belowdn)
{
#define MKINDEX(_name, _inst, _sys, _type1, _type2, _type3) do { \
- char *_type2str = (_type2), *_type3str = (_type3); \
+ char *_type2str = (_type2), *_type3str = (_type3); \
fprintf(f, "dn: cn=%s,%s\n", (_name), (_inst)); \
fprintf(f, "objectclass: top\n"); \
fprintf(f, "objectclass: nsIndex\n"); \
fprintf(f, "cn: %s\n", (_name)); \
fprintf(f, "nssystemindex: %s\n", (_sys) ? "true" : "false"); \
- if (_type1) \
+ if (_type1) \
fprintf(f, "nsindextype: %s\n", (_type1)); \
if (_type2str) \
fprintf(f, "nsindextype: %s\n", _type2str); \
@@ -4455,7 +4543,7 @@
PR_snprintf(cs_path, sizeof(cs_path), "%s%c"PRODUCT_NAME"-%s", sroot, FILE_PATHSEP, cf->servid);
/* create all / */
- if ( (t = ds_cre_subdirs(sroot, cf, cs_path, pw)) )
+ if ( (t = ds_cre_subdirs(cf, pw)) )
return(t);
/* Generate all scripts */
@@ -4473,28 +4561,29 @@
PR_snprintf(src, sizeof(src), "%s%cbin%c"PRODUCT_NAME"%cinstall%cldif%cExample.ldif", sroot, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP,
FILE_PATHSEP);
- PR_snprintf(dest, sizeof(dest), "%s%cldif%cExample.ldif", cs_path, FILE_PATHSEP, FILE_PATHSEP);
+ PR_snprintf(dest, sizeof(dest), "%s%cExample.ldif", cf->ldif_dir, FILE_PATHSEP);
create_instance_copy(src, dest, NEWFILE_MODE);
chownfile (pw, dest);
PR_snprintf(src, sizeof(src), "%s%cbin%c"PRODUCT_NAME"%cinstall%cldif%cExample-roles.ldif", sroot, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP,
FILE_PATHSEP);
- PR_snprintf(dest, sizeof(dest), "%s%cldif%cExample-roles.ldif", cs_path, FILE_PATHSEP, FILE_PATHSEP);
+ PR_snprintf(dest, sizeof(dest), "%s%cExample-roles.ldif", cf->ldif_dir, FILE_PATHSEP);
create_instance_copy(src, dest, NEWFILE_MODE);
chownfile (pw, dest);
PR_snprintf(src, sizeof(src), "%s%cbin%c"PRODUCT_NAME"%cinstall%cldif%cExample-views.ldif", sroot, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP,
FILE_PATHSEP);
- PR_snprintf(dest, sizeof(dest), "%s%cldif%cExample-views.ldif", cs_path, FILE_PATHSEP, FILE_PATHSEP);
+ PR_snprintf(dest, sizeof(dest), "%s%cExample-views.ldif", cf->ldif_dir, FILE_PATHSEP);
create_instance_copy(src, dest, NEWFILE_MODE);
chownfile (pw, dest);
PR_snprintf(src, sizeof(src), "%s%cbin%c"PRODUCT_NAME"%cinstall%cldif%cEuropean.ldif", sroot, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP,
FILE_PATHSEP);
- PR_snprintf(dest, sizeof(dest), "%s%cldif%cEuropean.ldif", cs_path, FILE_PATHSEP, FILE_PATHSEP);
+ PR_snprintf(dest, sizeof(dest), "%s%cEuropean.ldif", cf->ldif_dir, FILE_PATHSEP);
create_instance_copy(src, dest, NEWFILE_MODE);
chownfile (pw, dest);
+#ifdef DSML
/* new code for dsml sample files */
PR_snprintf(src, sizeof(src), "%s%cbin%c"PRODUCT_NAME"%cinstall%cdsml%cExample.dsml", sroot, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP,
FILE_PATHSEP);
@@ -4513,6 +4602,7 @@
PR_snprintf(dest, sizeof(dest), "%s%cdsml%cEuropean.dsml", cs_path, FILE_PATHSEP, FILE_PATHSEP);
create_instance_copy(src, dest, NEWFILE_MODE);
chownfile (pw, dest);
+#endif
/*
If the user has specified an LDIF file to use to initialize the database,
@@ -4552,17 +4642,17 @@
{
int start_status = 0;
int verbose = 1;
- char instance_dir[PATH_SIZE], errorlog[PATH_SIZE];
+ char errorlog[PATH_SIZE];
if (getenv("USE_DEBUGGER"))
verbose = 0;
- /* slapd-nickname directory */
- PR_snprintf(instance_dir, sizeof(instance_dir), "%s%c"PRODUCT_NAME"-%s", sroot, FILE_PATHSEP,
- cf->servid);
/* error log file */
- PR_snprintf(errorlog, sizeof(errorlog), "%s%clogs%cerrors", instance_dir, FILE_PATHSEP,
- FILE_PATHSEP);
- start_status = ds_bring_up_server_install(verbose, instance_dir, errorlog);
+#if 0
+ PR_snprintf(errorlog, sizeof(errorlog), "%s%cerrors", cf->log_dir, FILE_PATHSEP,
+#else /* will go away */
+ PR_snprintf(errorlog, sizeof(errorlog), "%s%clogs%cerrors", cf->inst_dir, FILE_PATHSEP, FILE_PATHSEP);
+#endif
+ start_status = ds_bring_up_server_install(verbose, cf->inst_dir, errorlog);
if (start_status != DS_SERVER_UP)
{
@@ -4628,27 +4718,23 @@
memset( &query_vars, 0, sizeof(query_vars) );
if (!cf->use_existing_user_ds)
- query_vars.suffix = myStrdup( cf->suffix );
- query_vars.ssAdmID = myStrdup( cf->cfg_sspt_uid );
- query_vars.ssAdmPW1 = myStrdup( cf->cfg_sspt_uidpw );
- query_vars.ssAdmPW2 = myStrdup( cf->cfg_sspt_uidpw );
- query_vars.rootDN = myStrdup( cf->rootdn );
- query_vars.rootPW = myStrdup( cf->rootpw );
- query_vars.admin_domain =
- myStrdup( cf->admin_domain );
- query_vars.netscaperoot = myStrdup( cf->netscaperoot );
- query_vars.testconfig = myStrdup( cf->testconfig );
- query_vars.consumerDN = myStrdup(cf->consumerdn);
- query_vars.consumerPW = myStrdup(cf->consumerhashedpw);
+ query_vars.suffix = PL_strdup( cf->suffix );
+ query_vars.ssAdmID = PL_strdup( cf->cfg_sspt_uid );
+ query_vars.ssAdmPW1 = PL_strdup( cf->cfg_sspt_uidpw );
+ query_vars.ssAdmPW2 = PL_strdup( cf->cfg_sspt_uidpw );
+ query_vars.rootDN = PL_strdup( cf->rootdn );
+ query_vars.rootPW = PL_strdup( cf->rootpw );
+ query_vars.admin_domain = PL_strdup( cf->admin_domain );
+ query_vars.netscaperoot = PL_strdup( cf->netscaperoot );
+ query_vars.testconfig = PL_strdup( cf->testconfig );
+ query_vars.consumerDN = PL_strdup(cf->consumerdn);
+ query_vars.consumerPW = PL_strdup(cf->consumerhashedpw);
if (cf->cfg_sspt && !strcmp(cf->cfg_sspt, "1"))
query_vars.cfg_sspt = 1;
else
query_vars.cfg_sspt = 0;
- if (cf->suitespot3x_uid)
- query_vars.config_admin_uid = myStrdup(cf->suitespot3x_uid);
- else
- query_vars.config_admin_uid = myStrdup(cf->cfg_sspt_uid);
+ query_vars.config_admin_uid = PL_strdup(cf->cfg_sspt_uid);
memset(&slapd_conf, 0, sizeof(SLAPD_CONFIG));
if (sroot)
@@ -4734,30 +4820,30 @@
int create_config(server_config_s *cf)
{
char *t = NULL;
- char error_param[BIG_LINE] = {0};
+ char error_param[BIG_LINE] = {0};
t = create_server(cf, error_param);
if(t)
- {
- char *msg;
- if (error_param[0])
- {
- msg = PR_smprintf("%s.error:could not create server %s - %s",
- error_param, cf->servid, t);
- }
- else
- {
- msg = PR_smprintf("error:could not create server %s - %s",
- cf->servid, t);
- }
- ds_show_message(msg);
- PR_smprintf_free(msg);
- }
- else
- {
- ds_show_message("Created new Directory Server");
- return 0;
- }
+ {
+ char *msg;
+ if (error_param[0])
+ {
+ msg = PR_smprintf("%s.error:could not create server %s - %s",
+ error_param, cf->servid, t);
+ }
+ else
+ {
+ msg = PR_smprintf("error:could not create server %s - %s",
+ cf->servid, t);
+ }
+ ds_show_message(msg);
+ PR_smprintf_free(msg);
+ }
+ else
+ {
+ ds_show_message("Created new Directory Server");
+ return 0;
+ }
return 1;
}
@@ -4767,23 +4853,59 @@
static int check_passwords(char *pw1, char *pw2)
{
if (strcmp (pw1, pw2) != 0) {
- ds_report_error (DS_INCORRECT_USAGE, " different passwords",
- "Enter the password again."
- " The two passwords you entered are different.");
- return 1;
- }
-
+ ds_report_error (DS_INCORRECT_USAGE, " different passwords",
+ "Enter the password again."
+ " The two passwords you entered are different.");
+ return 1;
+ }
+
if ( ((int) strlen(pw1)) < 8 ) {
- ds_report_error (DS_INCORRECT_USAGE, " password too short",
- "The password must be at least 8 characters long.");
- return 1;
- }
+ ds_report_error (DS_INCORRECT_USAGE, " password too short",
+ "The password must be at least 8 characters long.");
+ return 1;
+ }
- return 0;
+ return 0;
}
-/* ------ Parse the results of a form and create a server from them ------- */
+static char *
+set_path_attribute(char *attr, char *defaultval, char *prefix)
+{
+ char *temp = ds_a_get_cgi_var(attr, NULL, NULL);
+ char *rstr = NULL;
+ if (prefix) {
+ if (NULL == temp || '\0' == *temp) {
+ rstr = PR_smprintf("%s%c%s", prefix, FILE_PATHSEP, defaultval);
+ } else {
+ rstr = PR_smprintf("%s%c%s", prefix, FILE_PATHSEP, temp);
+ }
+ } else {
+ if (NULL == temp || '\0' == *temp) {
+ rstr = defaultval;
+ } else {
+ rstr = PL_strdup(temp);
+ }
+ }
+ return rstr;
+}
+/* ------ Parse the results of a form and create a server from them ------- */
+/*
+ * FHS description
+ * cf->prefix: %{_prefix}
+ * cf->sroot: %{_libdir}/BRAND_DS
+ * cf->localstatedir: %{_localstatedir}
+ * cf->sysconfdir: %{_sysconfdir}
+ * cf->bindir: %{_bindir}
+ * cf->datadir: %{_datadir}
+ * cf->docdir: %{_docdir}
+ * cf->inst_dir: /slapd-
+ * cf->config_dir: /lib/slapd-
+ * cf->schema_dir: /lib/slapd-/schema
+ * cf->lock_dir: /lock/slapd-
+ * cf->log_dir: /log/slapd-
+ * cf->run_dir: /run/slapd-
+ */
int parse_form(server_config_s *cf)
{
@@ -4793,94 +4915,103 @@
char* cfg_sspt_uid_pw2;
LDAPURLDesc *desc = 0;
char *temp = 0;
+ char *prefix = NULL;
- if (!(cf->sroot = getenv("NETSITE_ROOT"))) {
- ds_report_error (DS_INCORRECT_USAGE, " NETSITE_ROOT environment variable not set.",
- "The environment variable NETSITE_ROOT must be set to the server root directory.");
- return 1;
- }
+ cf->brand_ds = BRAND_DS;
+ temp = getenv("NETSITE_ROOT");
+ if (NULL == temp) {
+ ds_report_error (DS_INCORRECT_USAGE,
+ " NETSITE_ROOT environment variable not set.",
+ "The environment variable NETSITE_ROOT must be set to the server root directory.");
+ return 1;
+ }
+ cf->sroot = PL_strdup(temp);
if (rm && qs && !strcmp(rm, "GET"))
- {
- ds_get_begin(qs);
- }
+ {
+ ds_get_begin(qs);
+ }
else if (ds_post_begin(stdin))
- {
- return 1;
- }
+ {
+ return 1;
+ }
if (rm)
- {
- printf("Content-type: text/plain\n\n");
- }
+ {
+ printf("Content-type: text/plain\n\n");
+ }
/* else we are being called from server installation; no output */
+ temp = ds_a_get_cgi_var("prefix", NULL, NULL);
+ if (NULL != temp) {
+ prefix = cf->prefix = PL_strdup(temp);
+ }
+
if (!(cf->servname = ds_a_get_cgi_var("servname", "Server Name",
- "Please give a hostname for your server.")))
- {
- return 1;
- }
+ "Please give a hostname for your server.")))
+ {
+ return 1;
+ }
- cf->bindaddr = ds_a_get_cgi_var("bindaddr", NULL, NULL);
+ cf->bindaddr = ds_a_get_cgi_var("bindaddr", NULL, NULL);
if (!(cf->servport = ds_a_get_cgi_var("servport", "Server Port",
- "Please specify the TCP port number for this server.")))
- {
- return 1;
- }
+ "Please specify the TCP port number for this server.")))
+ {
+ return 1;
+ }
- cf->suitespot3x_uid = ds_a_get_cgi_var("suitespot3x_uid", NULL, NULL);
cf->cfg_sspt = ds_a_get_cgi_var("cfg_sspt", NULL, NULL);
cf->cfg_sspt_uid = ds_a_get_cgi_var("cfg_sspt_uid", NULL, NULL);
if (cf->cfg_sspt_uid && *(cf->cfg_sspt_uid) &&
- !(cf->cfg_sspt_uidpw = ds_a_get_cgi_var("cfg_sspt_uid_pw", NULL, NULL)))
- {
+ !(cf->cfg_sspt_uidpw = ds_a_get_cgi_var("cfg_sspt_uid_pw", NULL, NULL)))
+ {
+
+ if (!(cfg_sspt_uid_pw1 = ds_a_get_cgi_var("cfg_sspt_uid_pw1", "Password",
+ "Enter the password for the Mission Control Administrator's account.")))
+ {
+ return 1;
+ }
- if (!(cfg_sspt_uid_pw1 = ds_a_get_cgi_var("cfg_sspt_uid_pw1", "Password",
- "Enter the password for the Mission Control Administrator's account.")))
- {
- return 1;
- }
-
- if (!(cfg_sspt_uid_pw2 = ds_a_get_cgi_var("cfg_sspt_uid_pw2", "Password",
- "Enter the password for the Mission Control Administrator account, "
- "twice.")))
- {
- return 1;
- }
-
- if (strcmp (cfg_sspt_uid_pw1, cfg_sspt_uid_pw2) != 0)
- {
- ds_report_error (DS_INCORRECT_USAGE, " different passwords",
- "Enter the Mission Control Administrator account password again."
- " The two Mission Control Administrator account passwords "
- "you entered are different.");
- return 1;
- }
- if ( ((int) strlen(cfg_sspt_uid_pw1)) < 1 ) {
- ds_report_error (DS_INCORRECT_USAGE, " password too short",
- "The password must be at least 1 character long.");
- return 1;
- }
- cf->cfg_sspt_uidpw = cfg_sspt_uid_pw1;
- }
+ if (!(cfg_sspt_uid_pw2 = ds_a_get_cgi_var("cfg_sspt_uid_pw2", "Password",
+ "Enter the password for the Mission Control Administrator account, "
+ "twice.")))
+ {
+ return 1;
+ }
+
+ if (strcmp (cfg_sspt_uid_pw1, cfg_sspt_uid_pw2) != 0)
+ {
+ ds_report_error (DS_INCORRECT_USAGE, " different passwords",
+ "Enter the Mission Control Administrator account password again."
+ " The two Mission Control Administrator account passwords "
+ "you entered are different.");
+ return 1;
+ }
+ if ( ((int) strlen(cfg_sspt_uid_pw1)) < 1 ) {
+ ds_report_error (DS_INCORRECT_USAGE, " password too short",
+ "The password must be at least 1 character long.");
+ return 1;
+ }
+ cf->cfg_sspt_uidpw = cfg_sspt_uid_pw1;
+ }
if (cf->cfg_sspt && *cf->cfg_sspt && !strcmp(cf->cfg_sspt, "1") &&
- !cf->cfg_sspt_uid)
- {
- ds_report_error (DS_INCORRECT_USAGE,
- " Userid not specified",
- "A Userid for Mission Control Administrator must be specified.");
- return 1;
- }
+ !cf->cfg_sspt_uid)
+ {
+ ds_report_error (DS_INCORRECT_USAGE,
+ " Userid not specified",
+ "A Userid for Mission Control Administrator must be specified.");
+ return 1;
+ }
cf->start_server = ds_a_get_cgi_var("start_server", NULL, NULL);
cf->secserv = ds_a_get_cgi_var("secserv", NULL, NULL);
if (cf->secserv && strcmp(cf->secserv, "off"))
- cf->secservport = ds_a_get_cgi_var("secservport", NULL, NULL);
+ cf->secservport = ds_a_get_cgi_var("secservport", NULL, NULL);
if (!(cf->servid = ds_a_get_cgi_var("servid", "Server Identifier",
- "Please give your server a short identifier.")))
- {
- return 1;
- }
+ "Please give your server a short identifier.")))
+ {
+ return 1;
+ }
#ifdef XP_UNIX
cf->servuser = ds_a_get_cgi_var("servuser", NULL, NULL);
@@ -4889,82 +5020,177 @@
cf->suffix = dn_normalize_convert(ds_a_get_cgi_var("suffix", NULL, NULL));
if (cf->suffix == NULL) {
- cf->suffix = "";
+ cf->suffix = "";
}
cf->rootdn = dn_normalize_convert(ds_a_get_cgi_var("rootdn", NULL, NULL));
if (cf->rootdn && *(cf->rootdn)) {
- if (!(cf->rootpw = ds_a_get_cgi_var("rootpw", NULL, NULL)))
- {
- char* pw1 = ds_a_get_cgi_var("rootpw1", "Password",
- "Enter the password for the unrestricted user.");
- char* pw2 = ds_a_get_cgi_var("rootpw2", "Password",
- "Enter the password for the unrestricted user, twice.");
-
- if (!pw1 || !pw2 || check_passwords(pw1, pw2))
- {
- return 1;
- }
-
- cf->rootpw = pw1;
- }
- /* Encode the password in SSHA by default */
- cf->roothashedpw = (char *)ds_salted_sha1_pw_enc (cf->rootpw);
+ if (!(cf->rootpw = ds_a_get_cgi_var("rootpw", NULL, NULL)))
+ {
+ char* pw1 = ds_a_get_cgi_var("rootpw1", "Password",
+ "Enter the password for the unrestricted user.");
+ char* pw2 = ds_a_get_cgi_var("rootpw2", "Password",
+ "Enter the password for the unrestricted user, twice.");
+
+ if (!pw1 || !pw2 || check_passwords(pw1, pw2))
+ {
+ return 1;
+ }
+
+ cf->rootpw = pw1;
+ }
+ /* Encode the password in SSHA by default */
+ cf->roothashedpw = (char *)ds_salted_sha1_pw_enc (cf->rootpw);
}
cf->admin_domain = ds_a_get_cgi_var("admin_domain", NULL, NULL);
- if ((temp = ds_a_get_cgi_var("use_existing_config_ds", NULL, NULL))) {
- cf->use_existing_config_ds = atoi(temp);
- } else {
- cf->use_existing_config_ds = 1; /* there must already be one */
- }
-
- if ((temp = ds_a_get_cgi_var("use_existing_user_ds", NULL, NULL))) {
- cf->use_existing_config_ds = atoi(temp);
- } else {
- cf->use_existing_user_ds = 0; /* we are creating it */
- }
+ if ((temp = ds_a_get_cgi_var("use_existing_config_ds", NULL, NULL))) {
+ cf->use_existing_config_ds = atoi(temp);
+ } else {
+ cf->use_existing_config_ds = 1; /* there must already be one */
+ }
+
+ if ((temp = ds_a_get_cgi_var("use_existing_user_ds", NULL, NULL))) {
+ cf->use_existing_config_ds = atoi(temp);
+ } else {
+ cf->use_existing_user_ds = 0; /* we are creating it */
+ }
temp = ds_a_get_cgi_var("ldap_url", NULL, NULL);
if (temp && !ldap_url_parse(temp, &desc) && desc)
- {
- char *suffix;
- int isSSL;
-
- if (desc->lud_dn && *desc->lud_dn) { /* use given DN for netscaperoot suffix */
- cf->netscaperoot = strdup(desc->lud_dn);
- suffix = cf->netscaperoot;
- } else { /* use the default */
- suffix = dn_normalize_convert(strdup(cf->netscaperoot));
- }
- /* the config ds connection may require SSL */
- isSSL = !strncmp(temp, "ldaps:", strlen("ldaps:"));
- cf->config_ldap_url = PR_smprintf("ldap%s://%s:%d/%s",
- (isSSL ? "s" : ""), desc->lud_host,
- desc->lud_port, suffix);
- ldap_free_urldesc(desc);
- }
+ {
+ char *suffix;
+ int isSSL;
+
+ if (desc->lud_dn && *desc->lud_dn) { /* use given DN for netscaperoot suffix */
+ cf->netscaperoot = strdup(desc->lud_dn);
+ suffix = cf->netscaperoot;
+ } else { /* use the default */
+ suffix = dn_normalize_convert(strdup(cf->netscaperoot));
+ }
+ /* the config ds connection may require SSL */
+ isSSL = !strncmp(temp, "ldaps:", strlen("ldaps:"));
+ cf->config_ldap_url = PR_smprintf("ldap%s://%s:%d/%s",
+ (isSSL ? "s" : ""), desc->lud_host,
+ desc->lud_port, suffix);
+ ldap_free_urldesc(desc);
+ }
/* if being called as a CGI, the user_ldap_url will be the directory
we're creating */
/* this is the directory we're creating, and we cannot create an ssl
directory, so we don't have to worry about ldap vs ldaps here */
- if ((temp = ds_a_get_cgi_var("user_ldap_url", NULL, NULL))) {
- cf->user_ldap_url = strdup(temp);
- } else {
- cf->user_ldap_url = PR_smprintf("ldap://%s:%s/%s", cf->servname,
- cf->servport, cf->suffix);
- }
+ if ((temp = ds_a_get_cgi_var("user_ldap_url", NULL, NULL))) {
+ cf->user_ldap_url = strdup(temp);
+ } else {
+ cf->user_ldap_url = PR_smprintf("ldap://%s:%s/%s", cf->servname,
+ cf->servport, cf->suffix);
+ }
cf->samplesuffix = NULL;
cf->disable_schema_checking = ds_a_get_cgi_var("disable_schema_checking",
- NULL, NULL);
+ NULL, NULL);
cf->adminport = ds_a_get_cgi_var("adminport", NULL, NULL);
cf->install_ldif_file = ds_a_get_cgi_var("install_ldif_file", NULL, NULL);
+ cf->localstatedir = set_path_attribute("localstatedir", LOCALSTATEDIR, prefix);
+ cf->sysconfdir = set_path_attribute("sysconfdir", SYSCONFDIR, prefix);
+ cf->bindir = set_path_attribute("bindir", BINDIR, prefix);
+ cf->datadir = set_path_attribute("datadir", DATADIR, prefix);
+ cf->docdir = set_path_attribute("docdir", DOCDIR, prefix);
+
+ temp = ds_a_get_cgi_var("inst_dir", NULL, NULL);
+ if (NULL == temp) {
+ cf->inst_dir = PR_smprintf("%s%c%s-%s",
+ cf->sroot, FILE_PATHSEP, PRODUCT_NAME, cf->servid);
+ } else {
+ cf->inst_dir = PL_strdup(temp);
+ }
+
+ temp = ds_a_get_cgi_var("config_dir", NULL, NULL);
+ if (NULL == temp) {
+ cf->config_dir = PR_smprintf("%s%clib%c%s-%s",
+ cf->localstatedir, FILE_PATHSEP, FILE_PATHSEP,
+ PRODUCT_NAME, cf->servid);
+ } else {
+ cf->config_dir = PL_strdup(temp);
+ }
+ /* set config dir to the environment variable DS_CONFIG_DIR */
+ ds_set_config_dir(cf->config_dir);
+
+ cf->schema_dir = ds_a_get_cgi_var("schema_dir", NULL, NULL);
+ temp = ds_a_get_cgi_var("schema_dir", NULL, NULL);
+ if (NULL == temp) {
+ cf->schema_dir = PR_smprintf("%s%clib%c%s-%s%cschema",
+ cf->localstatedir, FILE_PATHSEP, FILE_PATHSEP,
+ PRODUCT_NAME, cf->servid, FILE_PATHSEP);
+ } else {
+ cf->schema_dir = PL_strdup(temp);
+ }
+
+ temp = ds_a_get_cgi_var("lock_dir", NULL, NULL);
+ if (NULL == temp) {
+ cf->lock_dir = PR_smprintf("%s%clock%c%s-%s",
+ cf->localstatedir, FILE_PATHSEP, FILE_PATHSEP,
+ PRODUCT_NAME, cf->servid);
+ } else {
+ cf->lock_dir = PL_strdup(temp);
+ }
+
+ temp = ds_a_get_cgi_var("log_dir", NULL, NULL);
+ if (NULL == temp) {
+#if 0
+ cf->log_dir = PR_smprintf("%s%clog%c%s-%s",
+ cf->localstatedir, FILE_PATHSEP, FILE_PATHSEP,
+ PRODUCT_NAME, cf->servid);
+#else /* will go away */
+ cf->log_dir = PR_smprintf("%s%clogs",
+ cf->inst_dir, FILE_PATHSEP);
+#endif
+ } else {
+ cf->log_dir = PL_strdup(temp);
+ }
+
+ temp = ds_a_get_cgi_var("run_dir", NULL, NULL);
+ if (NULL == temp) {
+ cf->run_dir = PR_smprintf("%s%crun%c%s-%s",
+ cf->localstatedir, FILE_PATHSEP, FILE_PATHSEP,
+ PRODUCT_NAME, cf->servid);
+ } else {
+ cf->run_dir = PL_strdup(temp);
+ }
+ /* set run dir to the environment variable DS_RUN_DIR */
+ ds_set_run_dir(cf->run_dir);
+
+ temp = ds_a_get_cgi_var("db_dir", NULL, NULL);
+ if (NULL == temp) {
+ cf->db_dir = PR_smprintf("%s%clib%c%s-%s%cdb",
+ cf->localstatedir, FILE_PATHSEP, FILE_PATHSEP,
+ PRODUCT_NAME, cf->servid, FILE_PATHSEP);
+ } else {
+ cf->db_dir = PL_strdup(temp);
+ }
+
+ temp = ds_a_get_cgi_var("bak_dir", NULL, NULL);
+ if (NULL == temp) {
+ cf->bak_dir = PR_smprintf("%s%clib%c%s-%s%cbak",
+ cf->localstatedir, FILE_PATHSEP, FILE_PATHSEP,
+ PRODUCT_NAME, cf->servid, FILE_PATHSEP);
+ } else {
+ cf->bak_dir = PL_strdup(temp);
+ }
+
+ temp = ds_a_get_cgi_var("ldif_dir", NULL, NULL);
+ if (NULL == temp) {
+ cf->ldif_dir = PR_smprintf("%s%c%s%cldif",
+ cf->datadir, FILE_PATHSEP, BRAND_DS, FILE_PATHSEP);
+ } else {
+ cf->ldif_dir = PL_strdup(temp);
+ }
+
return 0;
}
Index: create_instance.h
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/create_instance.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- create_instance.h 14 Mar 2006 17:13:38 -0000 1.6
+++ create_instance.h 27 Sep 2006 23:40:50 -0000 1.7
@@ -49,31 +49,46 @@
extern "C" { /* Assume C declarations for C++ */
#endif /* __cplusplus */
+#define BRAND_DS "fedora-ds"
+#define DS_CONFIG_DIR "DS_CONFIG_DIR"
+#define DS_CONFIG_FILE "dse.ldif"
#ifdef XP_UNIX
-#define PRODUCT_NAME "slapd"
-
-#define PRODUCT_BIN "ns-slapd"
-
+#define PRODUCT_NAME "slapd"
+#define PRODUCT_BIN "ns-slapd"
#endif
+#define LOCALSTATEDIR "/var"
+#define SYSCONFDIR "/etc"
+#define BINDIR "/bin"
+#define DATADIR "/share"
+#define DOCDIR "/usr/doc"
+
typedef struct {
- char *sroot;
+ char *sroot; /* _libdir */
+ char *localstatedir;
+ char *sysconfdir;
+ char *bindir;
+ char *datadir;
+ char *docdir;
+
+ char *brand_ds;
+ char *lang;
char *servname;
char *bindaddr;
char *servport;
- char *suitespot3x_uid;
- char *cfg_sspt;
- char *cfg_sspt_uid;
- char *cfg_sspt_uidpw;
+ char *suitespot3x_uid;
+ char *cfg_sspt;
+ char *cfg_sspt_uid;
+ char *cfg_sspt_uidpw;
char *secserv;
char *secservport;
char *ntsynch;
char *ntsynchssl;
char *ntsynchport;
char *rootdn;
- char *rootpw;
+ char *rootpw;
char *roothashedpw;
char *replicationdn;
char *replicationpw;
@@ -84,10 +99,10 @@
char *changelogdir;
char *changelogsuffix;
char *suffix;
- char *loglevel;
- char *netscaperoot;
- char *samplesuffix;
- char *testconfig;
+ char *loglevel;
+ char *netscaperoot;
+ char *samplesuffix;
+ char *testconfig;
char *servid;
#ifdef XP_UNIX
char *servuser;
@@ -97,16 +112,26 @@
char *maxthreads;
int upgradingServer;
- char * start_server;
+ char * start_server;
- char * admin_domain;
- char * config_ldap_url;
- char * user_ldap_url;
- int use_existing_user_ds;
- int use_existing_config_ds;
- char * disable_schema_checking;
- char * install_ldif_file;
- char *adminport;
+ char * admin_domain;
+ char * config_ldap_url;
+ char * user_ldap_url;
+ int use_existing_user_ds;
+ int use_existing_config_ds;
+ char * disable_schema_checking;
+ char * install_ldif_file;
+ char *adminport;
+ char *inst_dir;
+ char *config_dir;
+ char *schema_dir;
+ char *lock_dir;
+ char *log_dir;
+ char *run_dir;
+ char *db_dir;
+ char *bak_dir;
+ char *ldif_dir;
+ char *prefix;
} server_config_s;
Index: ds_newinst.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/ds_newinst.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ds_newinst.c 2 Sep 2005 20:40:48 -0000 1.4
+++ ds_newinst.c 27 Sep 2006 23:40:50 -0000 1.5
@@ -145,6 +145,7 @@
#if defined( hpux )
_exit(status);
+#else
+ exit(status);
#endif
- return status;
}
Index: ds_newinst.pl
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/ds_newinst.pl,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ds_newinst.pl 15 Sep 2006 14:59:47 -0000 1.7
+++ ds_newinst.pl 27 Sep 2006 23:40:50 -0000 1.8
@@ -213,6 +213,10 @@
$cgiargs{user_ldap_url} = $cgiargs{ldap_url};
}
+if ($table{General}->{prefix}) {
+ $cgiargs{prefix} = $table{General}->{prefix};
+}
+
# populate the DS with this file - the suffix in this file must
# be the suffix specified in the suffix argument above
# the filename should use the full absolute path
Index: makemccvlvindexes
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/makemccvlvindexes,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- makemccvlvindexes 21 Oct 2005 19:21:10 -0000 1.5
+++ makemccvlvindexes 27 Sep 2006 23:40:50 -0000 1.6
@@ -235,9 +235,9 @@
print "\n";
print "$#vlvnames VLV indices have been declared. Execute the following commands to build the index files.\n";
print "\n";
- print "\\stop\n";
- print "slapd db2index -f \\config\\slapd.conf -V @vlvnames\n";
- print "\\start\n";
+ print "\\stop\n";
+ print "slapd db2index -f -V @vlvnames\n";
+ print "\\start\n";
}
From fedora-directory-commits at redhat.com Wed Sep 27 23:40:54 2006
From: fedora-directory-commits at redhat.com (Noriko Hosoi (nhosoi))
Date: Wed, 27 Sep 2006 16:40:54 -0700
Subject: [Fedora-directory-commits]
ldapserver/ldap/servers/slapd/test-plugins testbind.c, 1.8, 1.9
Message-ID: <200609272341.k8RNfOUT016632@cvs-int.fedora.redhat.com>
Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/servers/slapd/test-plugins
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv16463/ldap/servers/slapd/test-plugins
Modified Files:
testbind.c
Log Message:
[207427] parameterizing the hardcoded paths (Comment #15)
phase 1. parameterizing config, schema and ldif directory
Index: testbind.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/test-plugins/testbind.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- testbind.c 23 Feb 2006 01:20:17 -0000 1.8
+++ testbind.c 27 Sep 2006 23:40:51 -0000 1.9
@@ -49,7 +49,7 @@
as the root DN.
To test this plug-in function, stop the server, edit the dse.ldif file
- (in the /slapd-/config directory)
+ (in the config directory)
and add the following lines before restarting the server :
dn: cn=Test Bind,cn=plugins,cn=config
From fedora-directory-commits at redhat.com Fri Sep 29 17:17:35 2006
From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins))
Date: Fri, 29 Sep 2006 10:17:35 -0700
Subject: [Fedora-directory-commits]
admservconsole/src/com/netscape/management/admserv
admserv.properties, 1.1.1.1, 1.2
Message-ID: <200609291717.k8THHZdi029771@cvs-int.fedora.redhat.com>
Author: rmeggins
Update of /cvs/dirsec/admservconsole/src/com/netscape/management/admserv
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv29660/admservconsole/src/com/netscape/management/admserv
Modified Files:
admserv.properties
Log Message:
bump version to 1.0.3
Index: admserv.properties
===================================================================
RCS file: /cvs/dirsec/admservconsole/src/com/netscape/management/admserv/admserv.properties,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- admserv.properties 22 May 2006 18:14:34 -0000 1.1.1.1
+++ admserv.properties 29 Sep 2006 17:17:27 -0000 1.2
@@ -22,7 +22,7 @@
# Admin Server Component Localization file
admin-title=Administration Server
-admin-version=Version 1.0.2
+admin-version=Version 1.0.3
admin-smallIcon=com/netscape/management/admserv/images/AdminServer.gif
admin-largeIcon=com/netscape/management/admserv/images/AdminServerL.gif
From fedora-directory-commits at redhat.com Fri Sep 29 17:17:22 2006
From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins))
Date: Fri, 29 Sep 2006 10:17:22 -0700
Subject: [Fedora-directory-commits] console build.properties,1.8,1.9
Message-ID: <200609291717.k8THHqoM029776@cvs-int.fedora.redhat.com>
Author: rmeggins
Update of /cvs/dirsec/console
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv29660/console
Modified Files:
build.properties
Log Message:
bump version to 1.0.3
Index: build.properties
===================================================================
RCS file: /cvs/dirsec/console/build.properties,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- build.properties 24 Mar 2006 01:04:00 -0000 1.8
+++ build.properties 29 Sep 2006 17:17:19 -0000 1.9
@@ -25,7 +25,7 @@
console.root=.
console.version=10
-console.dotversion=1.0.2
+console.dotversion=1.0.3
console.dotgenversion=1.0
mcc.core=${console.brand}-mcc
From fedora-directory-commits at redhat.com Fri Sep 29 17:17:27 2006
From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins))
Date: Fri, 29 Sep 2006 10:17:27 -0700
Subject: [Fedora-directory-commits]
console/src/com/netscape/management/client AboutDialog.java,
1.5, 1.6 default.properties, 1.4,
1.5 defaultLicense.properties, 1.4, 1.5
Message-ID: <200609291717.k8THHvqq029781@cvs-int.fedora.redhat.com>
Author: rmeggins
Update of /cvs/dirsec/console/src/com/netscape/management/client
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv29660/console/src/com/netscape/management/client
Modified Files:
AboutDialog.java default.properties defaultLicense.properties
Log Message:
bump version to 1.0.3
Index: AboutDialog.java
===================================================================
RCS file: /cvs/dirsec/console/src/com/netscape/management/client/AboutDialog.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- AboutDialog.java 24 Mar 2006 01:04:07 -0000 1.5
+++ AboutDialog.java 29 Sep 2006 17:17:20 -0000 1.6
@@ -179,7 +179,7 @@
AboutDialog dialog = new AboutDialog(f, "Fedora Management Console");
- dialog.setProduct(UIManager.getIcon("OptionPane.warningIcon"), "Fedora Management Console\056 Console 1.0.2\nCopyright (C) Red Hat, Inc.", "\n\nThis software is subject to the terms of a license agreement. Please do not use the software unless you agree to all the license terms");
+ dialog.setProduct(UIManager.getIcon("OptionPane.warningIcon"), "Fedora Management Console\056 Console 1.0.3\nCopyright (C) Red Hat, Inc.", "\n\nThis software is subject to the terms of a license agreement. Please do not use the software unless you agree to all the license terms");
dialog.addVendor(UIManager.getIcon("OptionPane.informationIcon"), "Contains Phaos SSL encryption software from Phaos Technology Corporation. Copyright © 1998 Phaos Technology Corporation. All Rights Reserved");
dialog.addVendor(UIManager.getIcon("OptionPane.informationIcon"), "Contains encryption software from RSA Data Security, Inc. Copyright © 1994 RSA Data Security, Inc. All rights reserved.");
Index: default.properties
===================================================================
RCS file: /cvs/dirsec/console/src/com/netscape/management/client/default.properties,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- default.properties 24 Mar 2006 01:04:07 -0000 1.4
+++ default.properties 29 Sep 2006 17:17:20 -0000 1.5
@@ -123,5 +123,5 @@
fontTab-fontProfile=Font Profile
fontTab-table_tt=Font table of screen elements and corresponding sample font
-banner-console=Fedora Management Console 1.0.2
+banner-console=Fedora Management Console 1.0.3
Index: defaultLicense.properties
===================================================================
RCS file: /cvs/dirsec/console/src/com/netscape/management/client/defaultLicense.properties,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- defaultLicense.properties 24 Mar 2006 01:04:07 -0000 1.4
+++ defaultLicense.properties 29 Sep 2006 17:17:20 -0000 1.5
@@ -17,7 +17,7 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# END COPYRIGHT BLOCK
#
-defaultAbout-dialogTitle=Fedora Management Console 1.0.2
+defaultAbout-dialogTitle=Fedora Management Console 1.0.3
defaultAbout-productLogo=com/netscape/management/client/images/logo32.gif
defaultAbout-productCopyright=Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.\nCopyright (C) 2005 Red Hat, Inc.\nAll rights reserved.
defaultAbout-productLicense=Fedora is a trademark of Red Hat, Inc. in the United States and other countries and is used by permission.
From fedora-directory-commits at redhat.com Fri Sep 29 17:17:28 2006
From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins))
Date: Fri, 29 Sep 2006 10:17:28 -0700
Subject: [Fedora-directory-commits] directoryconsole build.properties, 1.5,
1.6
Message-ID: <200609291717.k8THHwnf029786@cvs-int.fedora.redhat.com>
Author: rmeggins
Update of /cvs/dirsec/directoryconsole
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv29660/directoryconsole
Modified Files:
build.properties
Log Message:
bump version to 1.0.3
Index: build.properties
===================================================================
RCS file: /cvs/dirsec/directoryconsole/build.properties,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- build.properties 24 Mar 2006 00:52:50 -0000 1.5
+++ build.properties 29 Sep 2006 17:17:26 -0000 1.6
@@ -21,7 +21,7 @@
lang=en
ldapconsole.root=..
-ldapconsole.version=1.0.2
+ldapconsole.version=1.0.3
ldapconsole.gen.version=1.0
brand=fedora
ldapconsole.name=${brand}-ds-${ldapconsole.version}
From fedora-directory-commits at redhat.com Fri Sep 29 17:17:29 2006
From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins))
Date: Fri, 29 Sep 2006 10:17:29 -0700
Subject: [Fedora-directory-commits] admservconsole build.properties,1.2,1.3
Message-ID: <200609291717.k8THHxZ7029793@cvs-int.fedora.redhat.com>
Author: rmeggins
Update of /cvs/dirsec/admservconsole
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv29660/admservconsole
Modified Files:
build.properties
Log Message:
bump version to 1.0.3
Index: build.properties
===================================================================
RCS file: /cvs/dirsec/admservconsole/build.properties,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- build.properties 22 May 2006 19:48:18 -0000 1.2
+++ build.properties 29 Sep 2006 17:17:27 -0000 1.3
@@ -21,7 +21,7 @@
lang=en
admservconsole.root=..
-admservconsole.version=1.0.2
+admservconsole.version=1.0.3
admservconsole.gen.version=1.0
brand=fedora
admservconsole.name=${brand}-admserv-${admservconsole.version}
From fedora-directory-commits at redhat.com Fri Sep 29 17:17:28 2006
From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins))
Date: Fri, 29 Sep 2006 10:17:28 -0700
Subject: [Fedora-directory-commits]
console/src/com/netscape/management/client/console
Console.java, 1.6, 1.7 console.properties, 1.4, 1.5
Message-ID: <200609291718.k8THHwP6029785@cvs-int.fedora.redhat.com>
Author: rmeggins
Update of /cvs/dirsec/console/src/com/netscape/management/client/console
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv29660/console/src/com/netscape/management/client/console
Modified Files:
Console.java console.properties
Log Message:
bump version to 1.0.3
Index: Console.java
===================================================================
RCS file: /cvs/dirsec/console/src/com/netscape/management/client/console/Console.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- Console.java 24 Mar 2006 01:04:14 -0000 1.6
+++ Console.java 29 Sep 2006 17:17:25 -0000 1.7
@@ -56,7 +56,7 @@
// preference information
//
public static final String IDENTIFIER = "Console";
- public static final String VERSION = "1.0.2";
+ public static final String VERSION = "1.0.3";
public static final String MAJOR_VERSION = "1.0";
public static final String PREFERENCES_LOGIN =
IDENTIFIER + "." + VERSION + ".Login.preferences";
Index: console.properties
===================================================================
RCS file: /cvs/dirsec/console/src/com/netscape/management/client/console/console.properties,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- console.properties 24 Mar 2006 01:04:14 -0000 1.4
+++ console.properties 29 Sep 2006 17:17:25 -0000 1.5
@@ -18,7 +18,7 @@
# END COPYRIGHT BLOCK
#
console-title=Fedora Management Console
-console-displayVersion=1.0.2
+console-displayVersion=1.0.3
login-username=User ID:
login-password=Password:
From fedora-directory-commits at redhat.com Fri Sep 29 17:17:29 2006
From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins))
Date: Fri, 29 Sep 2006 10:17:29 -0700
Subject: [Fedora-directory-commits]
directoryconsole/src/com/netscape/admin/dirserv
about.properties, 1.3, 1.4 dirserv.properties, 1.4, 1.5
Message-ID: <200609291717.k8THHxGk029790@cvs-int.fedora.redhat.com>
Author: rmeggins
Update of /cvs/dirsec/directoryconsole/src/com/netscape/admin/dirserv
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv29660/directoryconsole/src/com/netscape/admin/dirserv
Modified Files:
about.properties dirserv.properties
Log Message:
bump version to 1.0.3
Index: about.properties
===================================================================
RCS file: /cvs/dirsec/directoryconsole/src/com/netscape/admin/dirserv/about.properties,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- about.properties 24 Mar 2006 00:52:57 -0000 1.3
+++ about.properties 29 Sep 2006 17:17:26 -0000 1.4
@@ -19,7 +19,7 @@
#
# Strings and logos used by the DSAboutDialog
-aboutDialog-dialogTitle=Fedora Directory Server 1.0.2
+aboutDialog-dialogTitle=Fedora Directory Server 1.0.3
aboutDialog-productLogo=com/netscape/management/client/images/logo32.gif
aboutDialog-productCopyright=Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.\nCopyright (C) 2005 Red Hat, Inc.\nAll rights reserved.
aboutDialog-productLicense=Fedora is a trademark of Red Hat, Inc. in the United States and other countries and is used by permission.
Index: dirserv.properties
===================================================================
RCS file: /cvs/dirsec/directoryconsole/src/com/netscape/admin/dirserv/dirserv.properties,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- dirserv.properties 24 Mar 2006 00:52:57 -0000 1.4
+++ dirserv.properties 29 Sep 2006 17:17:26 -0000 1.5
@@ -164,9 +164,9 @@
#
dialog-configtitle=Fedora Directory Server
dsAdmin-title=Fedora Directory Server
-dsAdmin-version=Version 1.0.2
+dsAdmin-version=Version 1.0.3
dsAdmin-nsServerPort=Port
-dsAdmin-framework-description=Fedora Directory Server Console 1.0.2
+dsAdmin-framework-description=Fedora Directory Server Console 1.0.3
dsAdmin-remove-server-cgi-failed=ds_remove failure
#
From fedora-directory-commits at redhat.com Fri Sep 29 18:25:14 2006
From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins))
Date: Fri, 29 Sep 2006 11:25:14 -0700
Subject: [Fedora-directory-commits] adminserver/admserv/cfgstuff
admserv.conf, 1.15, 1.16
Message-ID: <200609291825.k8TIPEn7001021@cvs-int.fedora.redhat.com>
Author: rmeggins
Update of /cvs/dirsec/adminserver/admserv/cfgstuff
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv976/adminserver/admserv/cfgstuff
Modified Files:
admserv.conf
Log Message:
bump version to 1.0.3
Index: admserv.conf
===================================================================
RCS file: /cvs/dirsec/adminserver/admserv/cfgstuff/admserv.conf,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- admserv.conf 24 Mar 2006 19:13:32 -0000 1.15
+++ admserv.conf 29 Sep 2006 18:25:06 -0000 1.16
@@ -25,7 +25,7 @@
SetEnv ADMSERV_ROOT %%%sroot%%%/admin-serv/config/
ADMCacheLifeTime 600
-ADMServerVersionString "Fedora-Administrator/1.0.2"
+ADMServerVersionString "Fedora-Administrator/1.0.3"
ScriptAlias /clients/orgchart/bin/ "%%%sroot%%%/clients/orgchart/bin/"
ScriptAlias /clients/dsgw/bin/ "%%%sroot%%%/clients/dsgw/bin/"
From fedora-directory-commits at redhat.com Fri Sep 29 18:25:14 2006
From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins))
Date: Fri, 29 Sep 2006 11:25:14 -0700
Subject: [Fedora-directory-commits] adminserver/include/nt regparms.h, 1.9,
1.10
Message-ID: <200609291825.k8TIPEaE001027@cvs-int.fedora.redhat.com>
Author: rmeggins
Update of /cvs/dirsec/adminserver/include/nt
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv976/adminserver/include/nt
Modified Files:
regparms.h
Log Message:
bump version to 1.0.3
Index: regparms.h
===================================================================
RCS file: /cvs/dirsec/adminserver/include/nt/regparms.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- regparms.h 23 Feb 2006 01:12:51 -0000 1.9
+++ regparms.h 29 Sep 2006 18:25:12 -0000 1.10
@@ -46,19 +46,19 @@
/* Admin IDs */
#define ADM_ID_PRODUCT "admin"
#define ADM_NAME_SHORT "Administration"
-#define ADM_VERSION "1.0.2"
-#define ADM_NAME_VERSION "Administration 1.0.2"
+#define ADM_VERSION "1.0.3"
+#define ADM_NAME_VERSION "Administration 1.0.3"
#define ADM_NAME_SERVER "Administration Server"
#define ADM_NAME_FULL "Fedora Administration Server"
-#define ADM_NAME_FULL_VERSION "Fedora Administration Server 1.0.2"
-#define ADM_NAME_SERVICE "Fedora Administration 1.0.2"
+#define ADM_NAME_FULL_VERSION "Fedora Administration Server 1.0.3"
+#define ADM_NAME_SERVICE "Fedora Administration 1.0.3"
#define ADM_EXE "ns-admin.exe"
#define ADM_EXE_START "admin.exe"
#define ADM_ID_SERVICE "admin10"
-#define ADM_KEY_ROOT "Administration\\1.0.2"
+#define ADM_KEY_ROOT "Administration\\1.0.3"
#define ADM_SERVER_LST_NAME "adm:Netscape Enterprise Server"
#define ADM_DIR_ROOT "admin"
-#define ADM_NAME_UNINSTALL "Uninstall Administration Server 1.0.2"
+#define ADM_NAME_UNINSTALL "Uninstall Administration Server 1.0.3"
/* original definitions */
// Upper-level registry parameters
From fedora-directory-commits at redhat.com Fri Sep 29 18:25:08 2006
From: fedora-directory-commits at redhat.com (Richard Allen Megginson (rmeggins))
Date: Fri, 29 Sep 2006 11:25:08 -0700
Subject: [Fedora-directory-commits] adminserver components.mk, 1.52,
1.53 nsconfig.mk, 1.30, 1.31
Message-ID: <200609291825.k8TIPcpE001031@cvs-int.fedora.redhat.com>
Author: rmeggins
Update of /cvs/dirsec/adminserver
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv976/adminserver
Modified Files:
components.mk nsconfig.mk
Log Message:
bump version to 1.0.3
Index: components.mk
===================================================================
RCS file: /cvs/dirsec/adminserver/components.mk,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -r1.52 -r1.53
--- components.mk 16 Jun 2006 00:04:03 -0000 1.52
+++ components.mk 29 Sep 2006 18:25:06 -0000 1.53
@@ -356,7 +356,7 @@
# Console java classes
#############################################################
-NMCJDK_SUF = 1.0.2
+NMCJDK_SUF = 1.0.3
NMCJDK_GEN_SUF = 1.0
NMCJDK_RELDATE = 20060324
@@ -402,7 +402,7 @@
# Admserv Console java classes
#############################################################
-ADMSERVCONSOLE_SUF = 1.0.2
+ADMSERVCONSOLE_SUF = 1.0.3
ADMSERVCONSOLE_GEN_SUF = 1.0
ADMSERVCONSOLE_RELDATE = 20060615
Index: nsconfig.mk
===================================================================
RCS file: /cvs/dirsec/adminserver/nsconfig.mk,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- nsconfig.mk 15 Jun 2006 01:30:48 -0000 1.30
+++ nsconfig.mk 29 Sep 2006 18:25:06 -0000 1.31
@@ -530,7 +530,7 @@
endif
endif
-ADM_SUF=1.0.2
+ADM_SUF=1.0.3
ADM_GEN_SUF=1.0
# CLEAN THIS UP