ports/security/opencryptoki/files/patch-usr-sbin-pkcsslotd-shmem.c
Hiroki Sato 8c8d2c3d81 Update to 3.5. Notable changes are as follows:
- No longer required to run pkcs11_startup.

   pkcs11_startup and pkcs_slotd were shell scripts that created the
   config file, pk_config_data, which was read by pkcsslotd to get
   available slot information.

   The pk_config_data configuration file has been replaced with
   /etc/opencryptoki/opencryptoki.conf.

   In version 3, the pkcsslotd daemon reads opencryptoki.conf to get slot
   information. The opencryptoki.conf by default contains slot information
   for each token currently supported by opencryptoki with the exception of
   the ICSF token, which requires some initial setup.
   Please see man page for opencryptoki.conf for further information.

   Since pk_config_data is no longer required, pkcs11_startup and
   pkcs_slotd have been removed.
2016-05-18 17:22:59 +00:00

35 lines
1.2 KiB
C

--- usr/sbin/pkcsslotd/shmem.c.orig 2016-04-29 17:26:46 UTC
+++ usr/sbin/pkcsslotd/shmem.c
@@ -336,9 +336,9 @@ int CreateSharedMemory ( void ) {
}
// SAB Get the group information for the PKCS#11 group... fail if
// it does not exist
- grp = getgrnam("pkcs11");
+ grp = getgrnam(PKCS11GROUP);
if ( !grp ) {
- ErrLog("Group PKCS#11 does not exist ");
+ ErrLog("Group " PKCS11GROUP " does not exist ");
return FALSE; // Group does not exist... setup is wrong..
}
@@ -415,9 +415,9 @@ int CreateSharedMemory ( void ) {
int i;
char *buffer;
- grp = getgrnam("pkcs11");
+ grp = getgrnam(PKCS11GROUP);
if ( !grp ) {
- ErrLog("Group \"pkcs11\" does not exist! Please run %s/pkcs11_startup.",
+ ErrLog("Group " PKCS11GROUP " does not exist! Please run %s/pkcs11_startup.",
SBIN_PATH);
return FALSE; // Group does not exist... setup is wrong..
}
@@ -437,7 +437,7 @@ int CreateSharedMemory ( void ) {
return FALSE;
}
if (fchown(fd, 0, grp->gr_gid) == -1) {
- ErrLog("%s: fchown(%s, root, pkcs11): %s", __FUNCTION__, MAPFILENAME,
+ ErrLog("%s: fchown(%s, root, %s): %s", __FUNCTION__, MAPFILENAME, PKCS11GROUP,
strerror(errno));
close(fd);
return FALSE;