Bug 183820 - [patch] error in /usr/local/etc/periodic/security/410.pkg-audit
Summary: [patch] error in /usr/local/etc/periodic/security/410.pkg-audit
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: conf (show other bugs)
Version: 9.2-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-09 20:20 UTC by Christopher
Modified: 2018-06-11 16:24 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher 2013-11-09 20:20:00 UTC
I think I found an error in one of the periodic security pkg scripts:
/usr/local/etc/periodic/security/410.pkg-audit

the awk expression to set PKG_DBDIR variable is
awk -F: '$1 ~ /PKG_DBDIR$/ { print $2 }'

this does not work because the line is as
PKG_DBDIR: /.../....

so the variable PKG_DBDIR is " /.../..."
there is a space at the beginning of the script.

next the stat command failed because of the space
stat -f %m " /.../...."

Fix: 

I suggest the following modification:

awk -F ': ' '$1 ~ /PKG_DBDIR$/ { print $2 }'
How-To-Repeat: you can run :

sh -f -x /usr/local/etc/periodic/security/410.pkg-audit
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:59:12 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped