Bug 221212 - security/softhsm2 uses hard-coded data-directories
Summary: security/softhsm2 uses hard-coded data-directories
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-04 01:13 UTC by dewayne
Modified: 2017-08-18 16:11 UTC (History)
1 user (show)

See Also:
jaap: maintainer-feedback+


Attachments
patch to fix problem (1.32 KB, patch)
2017-08-10 11:47 UTC, Jaap Akkerhuis
jaap: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description dewayne 2017-08-04 01:13:12 UTC
Thank-you for upgrading softhsm2.  Without changing anything, the software functions on FreeBSD 11.1Stable for both i386 and amd64.
However if the directories.tokendir changes from the default in softhsm2.conf, this results on both platforms:

# softhsm2-util --init-token --free --label "Cute label" --so-pin abcdef --pin 123456
ERROR: Could not initialize the PKCS#11 library/module: /usr/local/lib/softhsm/libsofthsm2.so
ERROR: Please check log files for additional information.

(Aside: there was no logging information)

In our case we prefer
directories.tokendir = /var/lib/softhsm/tokens/

We tried changes in the Makefile around
STATE_DIR?=     /var                            # Previously /usr/local/var
TOKEN_DIR?=     ${STATE_DIR}/lib/softhsm/tokens # Used in pkg-plist

CONFIGURE_ARGS+=        --datarootdir=${TOKEN_DIR} --localstatedir=${STATE_DIR}
but were unsuccessful.

Why it matters? Once built and functional /usr is mounted read-only.
Comment 1 Jaap Akkerhuis 2017-08-09 14:37:20 UTC
Yes, it is something I planned to change and all the time seem to forget.

I'll send a patch (with some other minor fixes as well) ASAP
Comment 2 Jaap Akkerhuis 2017-08-10 11:47:42 UTC
Created attachment 185231 [details]
patch to fix problem

Dear Committer, please add the following message to /usr/ports/UPDATING:

  As of version 2.3.0_1, the storage directory for softhsm has
  changed from /usr/local/var/lib/softhsm to /var/lib/softhsm


Features:
    Path change for token storage directory

Changes:
    Use pkgconf for proper install
    Ignore GOST for openssl-devel
Comment 3 Jaap Akkerhuis 2017-08-16 08:27:22 UTC
Overtaken by events

This is now in the latest release, see also https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221515
Comment 4 Steve Wills freebsd_committer freebsd_triage 2017-08-18 16:00:23 UTC
Attachment 185231 [details] applies cleanly for me.
Comment 5 commit-hook freebsd_committer freebsd_triage 2017-08-18 16:11:06 UTC
A commit references this bug:

Author: swills
Date: Fri Aug 18 16:09:59 UTC 2017
New revision: 448254
URL: https://svnweb.freebsd.org/changeset/ports/448254

Log:
  security/softhsm2: fix storage directory

  PR:		221212
  Submitted by:	jaap@NLnetLabs.nl (maintainer)
  Reported by:	dewayne@heuristicsystems.com.au

Changes:
  head/security/softhsm2/Makefile
  head/security/softhsm2/files/pkg-message.in
  head/security/softhsm2/pkg-plist
Comment 6 Steve Wills freebsd_committer freebsd_triage 2017-08-18 16:11:30 UTC
Committed, thanks!