- rebuilt with CCA enabled (#604287)

- fixed issues from #546274
This commit is contained in:
Dan Horák 2010-06-29 08:19:03 +00:00
parent 4deba9f2d2
commit 143e398327
2 changed files with 213 additions and 4 deletions

View File

@ -0,0 +1,194 @@
From d0c56c2b21e381ddb49c1906ad00d77684c4bc9b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Tue, 18 May 2010 11:32:22 +0200
Subject: [PATCH 1/3] add -h command line option
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The recent code treats -h as unknown options and throws an error.
Signed-off-by: Dan Horák <dan@danny.cz>
---
man/man1/pkcsconf.1.in | 4 +++-
usr/sbin/pkcsconf/pkcsconf.c | 8 ++++++--
usr/sbin/pkcsconf/pkcsconf.msg | 3 ++-
usr/sbin/pkcsconf/pkcsconf_msg.h | 1 +
4 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/man/man1/pkcsconf.1.in b/man/man1/pkcsconf.1.in
index a620882..6f5540a 100644
--- a/man/man1/pkcsconf.1.in
+++ b/man/man1/pkcsconf.1.in
@@ -4,7 +4,7 @@ pkcsconf
.SH SYNOPSIS
\fBpkcsconf\fP
-[\fB-itsmMIupP\fP]
+[\fB-itsmMIupPh\fP]
[\fB-c\fP \fIslotnumber\fP \fB-U\fP \fIuserPIN\fP
\fB-S\fP \fISOPin\fP \fB-n\fP \fInewpin\fP]
@@ -40,6 +40,8 @@ the current Security Officer (SO) pin (for use when changing the SO pin;
.IP "\fB-n\fP \fINEWPIN\fP" 10
the new pin (for use when changing either the user pin or the SO pin; -u, -p
and -P options); if not specified, user will be prompted
+.IP "\fB-h\fP" 10
+show usage information
.SH SEE ALSO
.PD 0
diff --git a/usr/sbin/pkcsconf/pkcsconf.c b/usr/sbin/pkcsconf/pkcsconf.c
index 30a143a..768f1ec 100755
--- a/usr/sbin/pkcsconf/pkcsconf.c
+++ b/usr/sbin/pkcsconf/pkcsconf.c
@@ -375,7 +375,7 @@ main(int argc, char *argv[]){
catd = catopen(MF_PKCSCONF,0);
/* Parse the command line parameters */
- while ((c = getopt (argc, argv, "itsmMIc:S:U:upPn:l")) != (-1)){
+ while ((c = getopt (argc, argv, "itsmMIc:S:U:upPn:lh")) != (-1)){
switch (c){
case 'c': /* a specific card (slot) is specified */
flags |= CFG_SLOT;
@@ -429,6 +429,9 @@ main(int argc, char *argv[]){
case 'l': /* display slot description */
flags |= CFG_LIST_SLOT;
break;
+ case 'h': /* display command line options */
+ usage(argv[0]);
+ break;
default: /* if something else was passed in it is an error */
errflag++;
break;
@@ -1295,7 +1298,7 @@ usage(char *progname){
/* If we get here the user needs help, so give it to them */
printf(PKCSINIT_MSG(USAGE,
- "usage:\t%s [-itsmMIupP] [-c slotnumber -U userPIN -S SOPin -n newpin]\n"),
+ "usage:\t%s [-itsmMIupPh] [-c slotnumber -U userPIN -S SOPin -n newpin]\n"),
progname);
printf(PKCSINIT_MSG(USAGE1, "\t-i display PKCS11 info\n"));
printf(PKCSINIT_MSG(USAGE2, "\t-t display token info\n"));
@@ -1305,6 +1308,7 @@ usage(char *progname){
printf(PKCSINIT_MSG(USAGE7, "\t-u initialize user PIN\n"));
printf(PKCSINIT_MSG(USAGE8, "\t-p set the user PIN\n"));
printf(PKCSINIT_MSG(USAGE9, "\t-P set the SO PIN\n"));
+ printf(PKCSINIT_MSG(USAGE10, "\t-h show this help\n"));
exit(-1);
}
diff --git a/usr/sbin/pkcsconf/pkcsconf.msg b/usr/sbin/pkcsconf/pkcsconf.msg
index 4b5fdf9..bce440b 100755
--- a/usr/sbin/pkcsconf/pkcsconf.msg
+++ b/usr/sbin/pkcsconf/pkcsconf.msg
@@ -373,7 +373,7 @@ LIBERROR "Error initializing the PKCS11 library: 0x%X\n"
SLOTMGRERROR "Error communicating with slot manager: 0x%X\n"
INVALIDCARD "Invalid card: %s\n"
-USAGE "usage:\t%s [-iImMpPstu] [-c slotnumber -U userPIN -S SOPin -n newPIN]\n"
+USAGE "usage:\t%s [-iImMpPstuh] [-c slotnumber -U userPIN -S SOPin -n newPIN]\n"
USAGE1 "\t-i display PKCS11 info\n"
USAGE2 "\t-t display token info\n"
USAGE3 "\t-s display slot info\n"
@@ -383,3 +383,4 @@ USAGE6 "\t-I initialize token\n"
USAGE7 "\t-u initialize user PIN\n"
USAGE8 "\t-p set the user PIN\n"
USAGE9 "\t-P set the SO PIN\n"
+USAGE10 "\t-h show this help\n"
diff --git a/usr/sbin/pkcsconf/pkcsconf_msg.h b/usr/sbin/pkcsconf/pkcsconf_msg.h
index 1ca9c04..f500dbc 100755
--- a/usr/sbin/pkcsconf/pkcsconf_msg.h
+++ b/usr/sbin/pkcsconf/pkcsconf_msg.h
@@ -378,4 +378,5 @@
#define USAGE7 68
#define USAGE8 69
#define USAGE9 70
+#define USAGE10 71
#endif
--
1.6.6.1
From 248606bef048d70f8fe366b846c6296ba6d92720 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Tue, 18 May 2010 11:32:23 +0200
Subject: [PATCH 2/3] print usage information when no option is given
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
When no option is given pkcsconf does nothing and quits silently with a zero
return code. It should output the usage information and return non-zero code.
Signed-off-by: Dan Horák <dan@danny.cz>
---
usr/sbin/pkcsconf/pkcsconf.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/usr/sbin/pkcsconf/pkcsconf.c b/usr/sbin/pkcsconf/pkcsconf.c
index 768f1ec..bb12a90 100755
--- a/usr/sbin/pkcsconf/pkcsconf.c
+++ b/usr/sbin/pkcsconf/pkcsconf.c
@@ -440,6 +440,9 @@ main(int argc, char *argv[]){
if (errflag != 0) /* If there was an error print the usage statement */
usage(argv[0]);
+ if (!flags) /* If there was no options print the usage statement */
+ usage(argv[0]);
+
/* Eliminate the ability to specify -I -p -u -P without a slot number */
if ( (flags & (CFG_INITIALIZE | CFG_INIT_USER | CFG_SET_USER | CFG_SET_SO))
&& !(flags & CFG_SLOT)){
--
1.6.6.1
From 9afec58b81c13ecec417e976721e2a22e8355978 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Thu, 20 May 2010 14:17:23 +0200
Subject: [PATCH 3/3] don't show the -M option
Recent builds are done with SHM undefined, so displaying the -M option that
depends on SHM, doesn't make sense.
---
usr/sbin/pkcsconf/pkcsconf.c | 4 ++--
usr/sbin/pkcsconf/pkcsconf.msg | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/usr/sbin/pkcsconf/pkcsconf.c b/usr/sbin/pkcsconf/pkcsconf.c
index bb12a90..0cf99d2 100755
--- a/usr/sbin/pkcsconf/pkcsconf.c
+++ b/usr/sbin/pkcsconf/pkcsconf.c
@@ -375,7 +375,7 @@ main(int argc, char *argv[]){
catd = catopen(MF_PKCSCONF,0);
/* Parse the command line parameters */
- while ((c = getopt (argc, argv, "itsmMIc:S:U:upPn:lh")) != (-1)){
+ while ((c = getopt (argc, argv, "itsmIc:S:U:upPn:lh")) != (-1)){
switch (c){
case 'c': /* a specific card (slot) is specified */
flags |= CFG_SLOT;
@@ -1301,7 +1301,7 @@ usage(char *progname){
/* If we get here the user needs help, so give it to them */
printf(PKCSINIT_MSG(USAGE,
- "usage:\t%s [-itsmMIupPh] [-c slotnumber -U userPIN -S SOPin -n newpin]\n"),
+ "usage:\t%s [-itsmIupPh] [-c slotnumber -U userPIN -S SOPin -n newpin]\n"),
progname);
printf(PKCSINIT_MSG(USAGE1, "\t-i display PKCS11 info\n"));
printf(PKCSINIT_MSG(USAGE2, "\t-t display token info\n"));
diff --git a/usr/sbin/pkcsconf/pkcsconf.msg b/usr/sbin/pkcsconf/pkcsconf.msg
index bce440b..0d3ed34 100755
--- a/usr/sbin/pkcsconf/pkcsconf.msg
+++ b/usr/sbin/pkcsconf/pkcsconf.msg
@@ -373,7 +373,7 @@ LIBERROR "Error initializing the PKCS11 library: 0x%X\n"
SLOTMGRERROR "Error communicating with slot manager: 0x%X\n"
INVALIDCARD "Invalid card: %s\n"
-USAGE "usage:\t%s [-iImMpPstuh] [-c slotnumber -U userPIN -S SOPin -n newPIN]\n"
+USAGE "usage:\t%s [-iImpPstuh] [-c slotnumber -U userPIN -S SOPin -n newPIN]\n"
USAGE1 "\t-i display PKCS11 info\n"
USAGE2 "\t-t display token info\n"
USAGE3 "\t-s display slot info\n"
--
1.6.6.1

View File

@ -1,7 +1,7 @@
Name: opencryptoki
Summary: Implementation of the PKCS#11 (Cryptoki) specification v2.11
Version: 2.3.1
Release: 5%{?dist}
Release: 6%{?dist}
License: CPL
Group: System Environment/Base
URL: http://sourceforge.net/projects/opencryptoki
@ -9,10 +9,14 @@ Source: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
Patch0: %{name}-2.2.8-do-not-create-group-in-pkcs11_startup.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=522149
# https://sourceforge.net/tracker/?func=detail&aid=2992772&group_id=128009&atid=710344
Patch2: %{name}-2.3.0-lsb.patch
Patch1: %{name}-2.3.0-lsb.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=547324
# https://sourceforge.net/tracker/?func=detail&aid=2992760&group_id=128009&atid=710344
Patch3: %{name}-2.3.1-pidfile.patch
Patch2: %{name}-2.3.1-pidfile.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=546274
# https://sourceforge.net/mailarchive/forum.php?thread_name=1274175144-26515-1-git-send-email-dan%40danny.cz&forum_name=opencryptoki-tech
# https://sourceforge.net/mailarchive/forum.php?thread_name=1274175144-26515-2-git-send-email-dan%40danny.cz&forum_name=opencryptoki-tech
Patch3: %{name}-2.3.1-bz546274.patch
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
Requires(pre): shadow-utils coreutils sed
Requires(post): chkconfig
@ -52,6 +56,7 @@ based applications.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
@ -60,7 +65,12 @@ based applications.
find . -name '*.[ch]' -print0 | xargs -0 chmod -x
./bootstrap.sh
%configure --enable-tpmtok
%configure \
%ifarch s390 s390x
--enable-ccatok \
%endif
--enable-tpmtok
make %{?_smp_mflags}
%install
@ -81,6 +91,7 @@ mkdir -p $RPM_BUILD_ROOT/%{_sharedstatedir}/%{name}
rm -rf doc/CVS
rm -f $RPM_BUILD_ROOT/%{_libdir}/%{name}/*.la
rm -f $RPM_BUILD_ROOT/%{_libdir}/%{name}/stdll/*.la
rm -rf $RPM_BUILD_ROOT/%{_datadir}/%{name}
%clean
rm -rf $RPM_BUILD_ROOT
@ -144,6 +155,10 @@ exit 0
%changelog
* Tue Jun 29 2010 Dan Horák <dan[at]danny.cz> 2.3.1-6
- rebuilt with CCA enabled (#604287)
- fixed issues from #546274
* Fri Apr 30 2010 Dan Horák <dan[at]danny.cz> 2.3.1-5
- fixed one more issue in the initscript (#547324)