Dan Horák píše v Út 18. 05. 2010 v 11:32 +0200: > The option -M is show in the summary of available options even when > opencprytoki > is built without the SHM defined.
I am not sure whether this the best way how to deal with the inconsistency of available command line options when built with/without SHM defined. But at least I tried :-) Dan > Signed-off-by: Dan Horák <[email protected]> > --- > man/man1/pkcsconf.1.in | 2 ++ > usr/sbin/pkcsconf/pkcsconf.c | 12 ++++++++++++ > usr/sbin/pkcsconf/pkcsconf.msg | 2 ++ > usr/sbin/pkcsconf/pkcsconf_msg.h | 2 ++ > 4 files changed, 18 insertions(+), 0 deletions(-) > > diff --git a/man/man1/pkcsconf.1.in b/man/man1/pkcsconf.1.in > index 6f5540a..7325898 100644 > --- a/man/man1/pkcsconf.1.in > +++ b/man/man1/pkcsconf.1.in > @@ -21,6 +21,8 @@ display token info > display slot info > .IP "\fB-m\fP" 10 > display mechanism list > +.IP "\fB-M\fP" 10 > +display shared memory info (not available in all builds) > .IP "\fB-I\fP" 10 > initialize token > .IP "\fB-u\fP" 10 > diff --git a/usr/sbin/pkcsconf/pkcsconf.c b/usr/sbin/pkcsconf/pkcsconf.c > index bb12a90..4ef0c17 100755 > --- a/usr/sbin/pkcsconf/pkcsconf.c > +++ b/usr/sbin/pkcsconf/pkcsconf.c > @@ -375,7 +375,11 @@ main(int argc, char *argv[]){ > catd = catopen(MF_PKCSCONF,0); > > /* Parse the command line parameters */ > +#if SHM > while ((c = getopt (argc, argv, "itsmMIc:S:U:upPn:lh")) != (-1)){ > +#else > + while ((c = getopt (argc, argv, "itsmIc:S:U:upPn:lh")) != (-1)){ > +#endif > switch (c){ > case 'c': /* a specific card (slot) is specified */ > flags |= CFG_SLOT; > @@ -1300,13 +1304,21 @@ void > usage(char *progname){ > > /* If we get here the user needs help, so give it to them */ > +#if SHM > printf(PKCSINIT_MSG(USAGE, > "usage:\t%s [-itsmMIupPh] [-c slotnumber -U userPIN -S SOPin -n > newpin]\n"), > +#else > + printf(PKCSINIT_MSG(USAGE0, > + "usage:\t%s [-itsmIupPh] [-c slotnumber -U userPIN -S SOPin -n > newpin]\n"), > +#endif > progname); > printf(PKCSINIT_MSG(USAGE1, "\t-i display PKCS11 info\n")); > printf(PKCSINIT_MSG(USAGE2, "\t-t display token info\n")); > printf(PKCSINIT_MSG(USAGE3, "\t-s display slot info\n")); > printf(PKCSINIT_MSG(USAGE4, "\t-m display mechanism list\n")); > +#if SHM > + printf(PKCSINIT_MSG(USAGE11, "\t-M display shared memory info\n")); > +#endif > printf(PKCSINIT_MSG(USAGE6, "\t-I initialize token \n")); > printf(PKCSINIT_MSG(USAGE7, "\t-u initialize user PIN\n")); > printf(PKCSINIT_MSG(USAGE8, "\t-p set the user PIN\n")); > diff --git a/usr/sbin/pkcsconf/pkcsconf.msg b/usr/sbin/pkcsconf/pkcsconf.msg > index bce440b..2e58b1f 100755 > --- a/usr/sbin/pkcsconf/pkcsconf.msg > +++ b/usr/sbin/pkcsconf/pkcsconf.msg > @@ -374,6 +374,7 @@ 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" > +USAGE0 "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" > @@ -384,3 +385,4 @@ 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" > +USAGE11 "\t-M display shared memory info\n" > diff --git a/usr/sbin/pkcsconf/pkcsconf_msg.h > b/usr/sbin/pkcsconf/pkcsconf_msg.h > index f500dbc..ff1de1b 100755 > --- a/usr/sbin/pkcsconf/pkcsconf_msg.h > +++ b/usr/sbin/pkcsconf/pkcsconf_msg.h > @@ -379,4 +379,6 @@ > #define USAGE8 69 > #define USAGE9 70 > #define USAGE10 71 > +#define USAGE0 72 > +#define USAGE11 73 > #endif ------------------------------------------------------------------------------ _______________________________________________ Opencryptoki-tech mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opencryptoki-tech
