Bug 266727 - security/easy-rsa: incompatible "date" usage
Summary: security/easy-rsa: incompatible "date" usage
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Matthias Andree
URL: https://github.com/OpenVPN/easy-rsa/c...
Keywords:
Depends on:
Blocks:
 
Reported: 2022-09-30 14:38 UTC by topical
Modified: 2022-10-15 08:22 UTC (History)
2 users (show)

See Also:
mandree: maintainer-feedback+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description topical 2022-09-30 14:38:28 UTC
There is a single line that is not FreeBSD compatible:

```
       DATE=$(date --date \
               "+${EASYRSA_CERT_RENEW} days" \
               +"%y%m%d%H%M%S")
```

The "--date" parameter is linux only. 

Unfortunately, I don't know how to easily fix that.
Comment 1 Matthias Andree freebsd_committer freebsd_triage 2022-10-03 06:57:39 UTC
Hi Topical,

thanks for the report. 

One one solution would have been to make easyrsa depend on coreutils and use gdate instead, another one might have been to use date -j on FreeBSD
---but this particular offending code is slated for removal in 3.1.1,
so it will no longer be an issue once 3.1.1 will have been released (shortly).

See https://github.com/OpenVPN/easy-rsa/commit/0d03a6f657c9f695ee49d00be85e845c59d83de0
Comment 2 topical 2022-10-03 08:04:22 UTC
Hi Matthias,

adding more dependencies is something I don‘t really like and enhancing linux-specific code with FreeBSD-specific code isn’t nice either.

The commit you mentioned removes the problematic code. I like the idea and we can close the issue once the patch has been merged upstream.

Thank you!
Comment 3 commit-hook freebsd_committer freebsd_triage 2022-10-15 08:21:38 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=22ecf341139a2015b94b6e1a8da15239e5119732

commit 22ecf341139a2015b94b6e1a8da15239e5119732
Author:     Matthias Andree <mandree@FreeBSD.org>
AuthorDate: 2022-10-15 08:19:26 +0000
Commit:     Matthias Andree <mandree@FreeBSD.org>
CommitDate: 2022-10-15 08:21:21 +0000

    security/easy-rsa: update to v3.1.1

    Changelog:      https://github.com/OpenVPN/easy-rsa/releases/tag/v3.1.1
    Detailed:       https://github.com/OpenVPN/easy-rsa/compare/v3.1.0...v3.1.1

    also fixes
    PR:             266727
    Reported by:    topical@gmx.net

 security/easy-rsa/Makefile            |  6 ++---
 security/easy-rsa/distinfo            |  6 ++---
 security/easy-rsa/files/patch-easyrsa | 41 ++++++++++-------------------------
 3 files changed, 17 insertions(+), 36 deletions(-)
Comment 4 Matthias Andree freebsd_committer freebsd_triage 2022-10-15 08:22:04 UTC
This is supposed to be fix by the upgrade to v3.1.1.