Bug 208556

Summary: openvas support scripts fail with stat syntax errors
Product: Ports & Packages Reporter: kwinkelman
Component: Individual Port(s)Assignee: Tijl Coosemans <tijl>
Status: Closed FIXED    
Severity: Affects Some People    
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   

Description kwinkelman 2016-04-05 18:55:44 UTC
greenbone-certdata-sync, greenbone-scapdata-sync, openvas-certdata-sync, openvas-scapdata-sync scripts included with the openvas-manager-6.0.8_1 package do not complete successfully, and print the following error:

stat: illegal option -- c
usage: stat [-FLnq] [-f format | -l | -r | -s | -x] [-t timefmt] [file ...]

It appears that the scripts are expecting gnu stat.

There are two formats of stat in the scripts: stat -c "%Y" (Time of last modification as seconds since Epoch), and stat -c "%s" (Total size, in bytes).

The bsd forms of these formats appear to be: stat -f "%m" and stat -f "%z", respectively.

Steps to reproduce:
1. Run greenbone-certdata-sync (or any of the above scripts)
2. Script fails with above error
Comment 1 commit-hook freebsd_committer freebsd_triage 2016-04-05 19:51:16 UTC
A commit references this bug:

Author: tijl
Date: Tue Apr  5 19:50:24 UTC 2016
New revision: 412585
URL: https://svnweb.freebsd.org/changeset/ports/412585

Log:
  Port stat(1) calls in several scripts.

  PR:		208556
  Submitted by:	kwinkelman@mcclatchy.com
  MFH:		2016Q2

Changes:
  head/security/openvas-manager/Makefile
  head/security/openvas-manager/files/patch-tools+greenbone-certdata-sync.in
  head/security/openvas-manager/files/patch-tools+greenbone-scapdata-sync.in
  head/security/openvas-manager/files/patch-tools+openvas-certdata-sync.in
  head/security/openvas-manager/files/patch-tools+openvas-scapdata-sync.in
Comment 2 commit-hook freebsd_committer freebsd_triage 2016-04-06 07:04:15 UTC
A commit references this bug:

Author: tijl
Date: Wed Apr  6 07:03:44 UTC 2016
New revision: 412605
URL: https://svnweb.freebsd.org/changeset/ports/412605

Log:
  MFH: r412585

  Port stat(1) calls in several scripts.

  PR:		208556
  Submitted by:	kwinkelman@mcclatchy.com
  Approved by:	ports-secteam (junovitch)

Changes:
_U  branches/2016Q2/
  branches/2016Q2/security/openvas-manager/Makefile
  branches/2016Q2/security/openvas-manager/files/patch-tools+greenbone-certdata-sync.in
  branches/2016Q2/security/openvas-manager/files/patch-tools+greenbone-scapdata-sync.in
  branches/2016Q2/security/openvas-manager/files/patch-tools+openvas-certdata-sync.in
  branches/2016Q2/security/openvas-manager/files/patch-tools+openvas-scapdata-sync.in