Print this page
6621176 $SRC/cmd/cmd-crypto/cryptoadm/*.c seem to have syntax errors in the translation notes
*** 17,31 ****
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
! * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
- #pragma ident "%Z%%M% %I% %E% SMI"
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
--- 17,30 ----
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
! * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
*** 52,62 ****
CRYPTO_START,
CRYPTO_STOP,
CRYPTO_HELP };
/*
! * TRANSLATION_NOTE:
* Command keywords are not to be translated.
*/
static char *cmd_table[] = {
"list",
"disable",
--- 51,61 ----
CRYPTO_START,
CRYPTO_STOP,
CRYPTO_HELP };
/*
! * TRANSLATION_NOTE
* Command keywords are not to be translated.
*/
static char *cmd_table[] = {
"list",
"disable",
*** 81,91 ****
char cp_name[MAXPATHLEN];
enum provider_type_index cp_type;
} cryptoadm_provider_t;
/*
! * TRANSLATION_NOTE:
* Operand keywords are not to be translated.
*/
static const char *KN_PROVIDER = "provider=";
static const char *KN_MECH = "mechanism=";
static const char *KN_ALL = "all";
--- 80,90 ----
char cp_name[MAXPATHLEN];
enum provider_type_index cp_type;
} cryptoadm_provider_t;
/*
! * TRANSLATION_NOTE
* Operand keywords are not to be translated.
*/
static const char *KN_PROVIDER = "provider=";
static const char *KN_MECH = "mechanism=";
static const char *KN_ALL = "all";
*** 196,206 ****
static void
usage(void)
{
/*
! * TRANSLATION_NOTE:
* Command usage is not to be translated. Only the word "Usage:"
* along with localized expressions indicating what kind of value
* is expected for arguments.
*/
(void) fprintf(stderr, gettext("Usage:\n"));
--- 195,205 ----
static void
usage(void)
{
/*
! * TRANSLATION_NOTE
* Command usage is not to be translated. Only the word "Usage:"
* along with localized expressions indicating what kind of value
* is expected for arguments.
*/
(void) fprintf(stderr, gettext("Usage:\n"));
*** 250,260 ****
* Get the provider type. This function returns
* - PROV_UEF_LIB if provname contains an absolute path name
* - PROV_KEF_SOFT if provname is a base name only
* - PROV_KEF_HARD if provname contains one slash only and the slash is not
* the 1st character.
! * - PROV_BADNAME othewise.
*/
static int
get_provider_type(char *provname)
{
char *pslash1;
--- 249,259 ----
* Get the provider type. This function returns
* - PROV_UEF_LIB if provname contains an absolute path name
* - PROV_KEF_SOFT if provname is a base name only
* - PROV_KEF_HARD if provname contains one slash only and the slash is not
* the 1st character.
! * - PROV_BADNAME otherwise.
*/
static int
get_provider_type(char *provname)
{
char *pslash1;
*** 303,313 ****
strlen(KN_PROVIDER)) == 0 &&
strlen(argv[c]) > strlen(KN_PROVIDER)) {
if ((provstr = strdup(argv[c])) == NULL) {
int err = errno;
/*
! * TRANSLATION_NOTE:
* "get_provider" is a function name and should
* not be translated.
*/
cryptoerror(LOG_STDERR, "get_provider: %s.",
strerror(err));
--- 302,312 ----
strlen(KN_PROVIDER)) == 0 &&
strlen(argv[c]) > strlen(KN_PROVIDER)) {
if ((provstr = strdup(argv[c])) == NULL) {
int err = errno;
/*
! * TRANSLATION_NOTE
* "get_provider" is a function name and should
* not be translated.
*/
cryptoerror(LOG_STDERR, "get_provider: %s.",
strerror(err));
*** 481,491 ****
}
}
if (!found) {
if (!quiet)
/*
! * TRANSLATION_NOTE:
* "mechanism" could be either a literal keyword
* and hence not to be translated, or a descriptive
* word and translatable. A choice was made to
* view it as a literal keyword.
*/
--- 480,490 ----
}
}
if (!found) {
if (!quiet)
/*
! * TRANSLATION_NOTE
* "mechanism" could be either a literal keyword
* and hence not to be translated, or a descriptive
* word and translatable. A choice was made to
* view it as a literal keyword.
*/
*** 661,671 ****
if (getzoneid() == GLOBAL_ZONEID) {
rc = list_policy_for_soft(
prov->cp_name);
} else {
/*
! * TRANSLATION_NOTE:
* "global" is keyword and not to
* be translated.
*/
cryptoerror(LOG_STDERR, gettext(
"policy information for kernel "
--- 660,670 ----
if (getzoneid() == GLOBAL_ZONEID) {
rc = list_policy_for_soft(
prov->cp_name);
} else {
/*
! * TRANSLATION_NOTE
* "global" is keyword and not to
* be translated.
*/
cryptoerror(LOG_STDERR, gettext(
"policy information for kernel "
*** 678,688 ****
if (getzoneid() == GLOBAL_ZONEID) {
rc = list_policy_for_hard(
prov->cp_name);
} else {
/*
! * TRANSLATION_NOTE:
* "global" is keyword and not to
* be translated.
*/
cryptoerror(LOG_STDERR, gettext(
"policy information for kernel "
--- 677,687 ----
if (getzoneid() == GLOBAL_ZONEID) {
rc = list_policy_for_hard(
prov->cp_name);
} else {
/*
! * TRANSLATION_NOTE
* "global" is keyword and not to
* be translated.
*/
cryptoerror(LOG_STDERR, gettext(
"policy information for kernel "
*** 776,786 ****
if (getzoneid() == GLOBAL_ZONEID) {
rc = disable_kef_software(prov->cp_name, rndflag,
allflag, mecharglist);
} else {
/*
! * TRANSLATION_NOTE:
* "disable" could be either a literal keyword
* and hence not to be translated, or a verb and
* translatable. A choice was made to view it as
* a literal keyword. "global" is keyword and not
* to be translated.
--- 775,785 ----
if (getzoneid() == GLOBAL_ZONEID) {
rc = disable_kef_software(prov->cp_name, rndflag,
allflag, mecharglist);
} else {
/*
! * TRANSLATION_NOTE
* "disable" could be either a literal keyword
* and hence not to be translated, or a verb and
* translatable. A choice was made to view it as
* a literal keyword. "global" is keyword and not
* to be translated.
*** 801,811 ****
if (getzoneid() == GLOBAL_ZONEID) {
rc = disable_kef_hardware(prov->cp_name, rndflag,
allflag, mecharglist);
} else {
/*
! * TRANSLATION_NOTE:
* "disable" could be either a literal keyword
* and hence not to be translated, or a verb and
* translatable. A choice was made to view it as
* a literal keyword. "global" is keyword and not
* to be translated.
--- 800,810 ----
if (getzoneid() == GLOBAL_ZONEID) {
rc = disable_kef_hardware(prov->cp_name, rndflag,
allflag, mecharglist);
} else {
/*
! * TRANSLATION_NOTE
* "disable" could be either a literal keyword
* and hence not to be translated, or a verb and
* translatable. A choice was made to view it as
* a literal keyword. "global" is keyword and not
* to be translated.
*** 909,919 ****
if (getzoneid() == GLOBAL_ZONEID) {
rc = enable_kef(prov->cp_name, rndflag, allflag,
mecharglist);
} else {
/*
! * TRANSLATION_NOTE:
* "enable" could be either a literal keyword
* and hence not to be translated, or a verb and
* translatable. A choice was made to view it as
* a literal keyword. "global" is keyword and not
* to be translated.
--- 908,918 ----
if (getzoneid() == GLOBAL_ZONEID) {
rc = enable_kef(prov->cp_name, rndflag, allflag,
mecharglist);
} else {
/*
! * TRANSLATION_NOTE
* "enable" could be either a literal keyword
* and hence not to be translated, or a verb and
* translatable. A choice was made to view it as
* a literal keyword. "global" is keyword and not
* to be translated.
*** 960,970 ****
prov = get_provider(argc, argv);
if (prov == NULL ||
prov->cp_type == PROV_BADNAME || prov->cp_type == PROV_KEF_HARD) {
/*
! * TRANSLATION_NOTE:
* "install" could be either a literal keyword and hence
* not to be translated, or a verb and translatable. A
* choice was made to view it as a literal keyword.
*/
cryptoerror(LOG_STDERR,
--- 959,969 ----
prov = get_provider(argc, argv);
if (prov == NULL ||
prov->cp_type == PROV_BADNAME || prov->cp_type == PROV_KEF_HARD) {
/*
! * TRANSLATION_NOTE
* "install" could be either a literal keyword and hence
* not to be translated, or a verb and translatable. A
* choice was made to view it as a literal keyword.
*/
cryptoerror(LOG_STDERR,
*** 981,991 ****
/* It is the PROV_KEF_SOFT type now */
/* check if there are mechanism operands */
if (argc < 4) {
/*
! * TRANSLATION_NOTE:
* "mechanism" could be either a literal keyword and hence
* not to be translated, or a descriptive word and
* translatable. A choice was made to view it as a literal
* keyword.
*/
--- 980,990 ----
/* It is the PROV_KEF_SOFT type now */
/* check if there are mechanism operands */
if (argc < 4) {
/*
! * TRANSLATION_NOTE
* "mechanism" could be either a literal keyword and hence
* not to be translated, or a descriptive word and
* translatable. A choice was made to view it as a literal
* keyword.
*/
*** 1000,1010 ****
goto out;
}
if (allflag == B_TRUE) {
/*
! * TRANSLATION_NOTE:
* "all", "mechanism", and "install" are all keywords and
* not to be translated.
*/
cryptoerror(LOG_STDERR,
gettext("can not use the %1$s keyword for %2$s "
--- 999,1009 ----
goto out;
}
if (allflag == B_TRUE) {
/*
! * TRANSLATION_NOTE
* "all", "mechanism", and "install" are all keywords and
* not to be translated.
*/
cryptoerror(LOG_STDERR,
gettext("can not use the %1$s keyword for %2$s "
*** 1015,1025 ****
if (getzoneid() == GLOBAL_ZONEID) {
rc = install_kef(prov->cp_name, mecharglist);
} else {
/*
! * TRANSLATION_NOTE:
* "install" could be either a literal keyword and hence
* not to be translated, or a verb and translatable. A
* choice was made to view it as a literal keyword.
* "global" is keyword and not to be translated.
*/
--- 1014,1024 ----
if (getzoneid() == GLOBAL_ZONEID) {
rc = install_kef(prov->cp_name, mecharglist);
} else {
/*
! * TRANSLATION_NOTE
* "install" could be either a literal keyword and hence
* not to be translated, or a verb and translatable. A
* choice was made to view it as a literal keyword.
* "global" is keyword and not to be translated.
*/
*** 1050,1060 ****
prov = get_provider(argc, argv);
if (prov == NULL ||
prov->cp_type == PROV_BADNAME || prov->cp_type == PROV_KEF_HARD) {
/*
! * TRANSLATION_NOTE:
* "uninstall" could be either a literal keyword and hence
* not to be translated, or a verb and translatable. A
* choice was made to view it as a literal keyword.
*/
cryptoerror(LOG_STDERR,
--- 1049,1059 ----
prov = get_provider(argc, argv);
if (prov == NULL ||
prov->cp_type == PROV_BADNAME || prov->cp_type == PROV_KEF_HARD) {
/*
! * TRANSLATION_NOTE
* "uninstall" could be either a literal keyword and hence
* not to be translated, or a verb and translatable. A
* choice was made to view it as a literal keyword.
*/
cryptoerror(LOG_STDERR,
*** 1068,1078 ****
} else if (prov->cp_type == PROV_KEF_SOFT) {
if (getzoneid() == GLOBAL_ZONEID) {
rc = uninstall_kef(prov->cp_name);
} else {
/*
! * TRANSLATION_NOTE:
* "uninstall" could be either a literal keyword and
* hence not to be translated, or a verb and
* translatable. A choice was made to view it as a
* literal keyword. "global" is keyword and not to
* be translated.
--- 1067,1077 ----
} else if (prov->cp_type == PROV_KEF_SOFT) {
if (getzoneid() == GLOBAL_ZONEID) {
rc = uninstall_kef(prov->cp_name);
} else {
/*
! * TRANSLATION_NOTE
* "uninstall" could be either a literal keyword and
* hence not to be translated, or a verb and
* translatable. A choice was made to view it as a
* literal keyword. "global" is keyword and not to
* be translated.
*** 1120,1130 ****
goto out;
}
if (getzoneid() != GLOBAL_ZONEID) {
/*
! * TRANSLATION_NOTE:
* "unload" could be either a literal keyword and hence
* not to be translated, or a verb and translatable.
* A choice was made to view it as a literal keyword.
* "global" is keyword and not to be translated.
*/
--- 1119,1129 ----
goto out;
}
if (getzoneid() != GLOBAL_ZONEID) {
/*
! * TRANSLATION_NOTE
* "unload" could be either a literal keyword and hence
* not to be translated, or a verb and translatable.
* A choice was made to view it as a literal keyword.
* "global" is keyword and not to be translated.
*/
*** 1380,1390 ****
int rc = SUCCESS;
/* get user-level providers */
(void) printf(gettext("\nUser-level providers:\n"));
/*
! * TRANSLATION_NOTE:
* Strictly for appearance's sake, this line should be as long as
* the length of the translated text above.
*/
(void) printf(gettext("=====================\n"));
if (get_pkcs11conf_info(&pliblist) != SUCCESS) {
--- 1379,1389 ----
int rc = SUCCESS;
/* get user-level providers */
(void) printf(gettext("\nUser-level providers:\n"));
/*
! * TRANSLATION_NOTE
* Strictly for appearance's sake, this line should be as long as
* the length of the translated text above.
*/
(void) printf(gettext("=====================\n"));
if (get_pkcs11conf_info(&pliblist) != SUCCESS) {
*** 1410,1420 ****
free_uentrylist(pliblist);
/* get kernel software providers */
(void) printf(gettext("\nKernel software providers:\n"));
/*
! * TRANSLATION_NOTE:
* Strictly for appearance's sake, this line should be as long as
* the length of the translated text above.
*/
(void) printf(gettext("==========================\n"));
if (getzoneid() == GLOBAL_ZONEID) {
--- 1409,1419 ----
free_uentrylist(pliblist);
/* get kernel software providers */
(void) printf(gettext("\nKernel software providers:\n"));
/*
! * TRANSLATION_NOTE
* Strictly for appearance's sake, this line should be as long as
* the length of the translated text above.
*/
(void) printf(gettext("==========================\n"));
if (getzoneid() == GLOBAL_ZONEID) {
*** 1485,1495 ****
}
/* Get kernel hardware providers and their mechanism lists */
(void) printf(gettext("\nKernel hardware providers:\n"));
/*
! * TRANSLATION_NOTE:
* Strictly for appearance's sake, this line should be as long as
* the length of the translated text above.
*/
(void) printf(gettext("==========================\n"));
if (get_dev_list(&pdevlist_kernel) != SUCCESS) {
--- 1484,1494 ----
}
/* Get kernel hardware providers and their mechanism lists */
(void) printf(gettext("\nKernel hardware providers:\n"));
/*
! * TRANSLATION_NOTE
* Strictly for appearance's sake, this line should be as long as
* the length of the translated text above.
*/
(void) printf(gettext("==========================\n"));
if (get_dev_list(&pdevlist_kernel) != SUCCESS) {
*** 1540,1550 ****
int rc = SUCCESS;
/* Get user-level providers */
(void) printf(gettext("\nUser-level providers:\n"));
/*
! * TRANSLATION_NOTE:
* Strictly for appearance's sake, this line should be as long as
* the length of the translated text above.
*/
(void) printf(gettext("=====================\n"));
if (get_pkcs11conf_info(&pliblist) == FAILURE) {
--- 1539,1549 ----
int rc = SUCCESS;
/* Get user-level providers */
(void) printf(gettext("\nUser-level providers:\n"));
/*
! * TRANSLATION_NOTE
* Strictly for appearance's sake, this line should be as long as
* the length of the translated text above.
*/
(void) printf(gettext("=====================\n"));
if (get_pkcs11conf_info(&pliblist) == FAILURE) {
*** 1567,1577 ****
}
/* kernel software providers */
(void) printf(gettext("\nKernel software providers:\n"));
/*
! * TRANSLATION_NOTE:
* Strictly for appearance's sake, this line should be as long as
* the length of the translated text above.
*/
(void) printf(gettext("==========================\n"));
--- 1566,1576 ----
}
/* kernel software providers */
(void) printf(gettext("\nKernel software providers:\n"));
/*
! * TRANSLATION_NOTE
* Strictly for appearance's sake, this line should be as long as
* the length of the translated text above.
*/
(void) printf(gettext("==========================\n"));
*** 1598,1608 ****
free_entrylist(psoftlist_conf);
} else {
/* kcf.conf not there in non-global zone, no policy info */
/*
! * TRANSLATION_NOTE:
* "global" is keyword and not to be translated.
*/
cryptoerror(LOG_STDERR, gettext(
"policy information for kernel software providers is "
"available in the %s zone only"), "global");
--- 1597,1607 ----
free_entrylist(psoftlist_conf);
} else {
/* kcf.conf not there in non-global zone, no policy info */
/*
! * TRANSLATION_NOTE
* "global" is keyword and not to be translated.
*/
cryptoerror(LOG_STDERR, gettext(
"policy information for kernel software providers is "
"available in the %s zone only"), "global");
*** 1609,1627 ****
}
/* Kernel hardware providers */
(void) printf(gettext("\nKernel hardware providers:\n"));
/*
! * TRANSLATION_NOTE:
* Strictly for appearance's sake, this line should be as long as
* the length of the translated text above.
*/
(void) printf(gettext("==========================\n"));
if (getzoneid() != GLOBAL_ZONEID) {
/*
! * TRANSLATION_NOTE:
* "global" is keyword and not to be translated.
*/
cryptoerror(LOG_STDERR, gettext(
"policy information for kernel hardware providers is "
"available in the %s zone only"), "global");
--- 1608,1626 ----
}
/* Kernel hardware providers */
(void) printf(gettext("\nKernel hardware providers:\n"));
/*
! * TRANSLATION_NOTE
* Strictly for appearance's sake, this line should be as long as
* the length of the translated text above.
*/
(void) printf(gettext("==========================\n"));
if (getzoneid() != GLOBAL_ZONEID) {
/*
! * TRANSLATION_NOTE
* "global" is keyword and not to be translated.
*/
cryptoerror(LOG_STDERR, gettext(
"policy information for kernel hardware providers is "
"available in the %s zone only"), "global");