I have jailaudit-1.5.1 installed on a host along with ezjail. Last nights security run output contained: Downloading a current audit database: auditfile.tbz 96 kB 0 Bps New database installed. Database created: Tue Aug 5 03:05:01 BST 2014 /usr/local/bin/jailaudit: cannot create /usr/local/jailaudit/tmp/_jailaudit_allports: No such file or directory Checking for a current audit database: Database created: Tue Aug 5 03:05:01 BST 2014 Checking for packages with security vulnerabilities: 0 problem(s) in your installed packages found. The jailaudit error is new after the upgrade yesterday. Note: I have not migrated this system to pkgng yet, it is still using the old pkg_* tools.
(In reply to freebsd-bugzilla from comment #0) > I have jailaudit-1.5.1 installed on a host along with ezjail. Last nights > security run output contained: > > Downloading a current audit database: > auditfile.tbz 96 kB 0 Bps > New database installed. > Database created: Tue Aug 5 03:05:01 BST 2014 > > /usr/local/bin/jailaudit: cannot create > /usr/local/jailaudit/tmp/_jailaudit_allports: No such file or directory Is there a /usr/local/jailaudit/tmp directory? Do you get the same error message if you run the 'jailaudit generate' command by hand?
% ls -la /usr/local/jailaudit total 5 drwxr-xr-x 3 root wheel 3 Aug 5 00:00 . drwxr-xr-x 18 root wheel 18 Feb 13 18:17 .. drwxr-xr-x 2 root wheel 2 Aug 5 03:07 reports % jailaudit generate - ALL Downloading a current audit database: auditfile.tbz 100% of 96 kB 177 kBps 00m00s New database installed. Database created: Tue Aug 5 10:05:00 BST 2014 /usr/local/bin/jailaudit: cannot create /usr/local/jailaudit/tmp/_jailaudit_allports: No such file or directory %
maintainer in CC already
(In reply to Gary from comment #2) > % ls -la /usr/local/jailaudit > total 5 > drwxr-xr-x 3 root wheel 3 Aug 5 00:00 . > drwxr-xr-x 18 root wheel 18 Feb 13 18:17 .. > drwxr-xr-x 2 root wheel 2 Aug 5 03:07 reports > % jailaudit generate - ALL > > Downloading a current audit database: > auditfile.tbz 100% of 96 kB 177 kBps > 00m00s > New database installed. > Database created: Tue Aug 5 10:05:00 BST 2014 > > /usr/local/bin/jailaudit: cannot create > /usr/local/jailaudit/tmp/_jailaudit_allports: No such file or directory > % Looks like the port doesn't create the /usr/local/jailaudit directory when installed via old pkg. It does using pkgng. I'll look into that. To hotfix your problem you could create a /usr/local/jailaudit/tmp directory by hand.
Okay this bug was introduced when I converted the port to StageDir support. If I understand https://wiki.freebsd.org/ports/StageDir correctly "For pkg_tools compatibility add: @exec install -d -o user -g group -m mode %D/directory." then this patch to the port will solve the issue. I've tested this now on a old pkg host and there it works for me as well as on a pkgng host. diff -ruN /usr/ports/ports-mgmt/jailaudit/Makefile freebsd-port/Makefile --- /usr/ports/ports-mgmt/jailaudit/Makefile 2014-08-04 23:47:15.000000000 +0200 +++ freebsd-port/Makefile 2014-08-05 12:02:31.228606222 +0200 @@ -1,8 +1,9 @@ # Created by: Philipp Wuensche <cryx-ports@h3q.com> -# $FreeBSD: head/ports-mgmt/jailaudit/Makefile 364056 2014-08-04 21:47:15Z wg $ +# $FreeBSD$ PORTNAME= jailaudit PORTVERSION= 1.5.1 +PORTREVISION= 1 CATEGORIES= ports-mgmt MASTER_SITES= http://outpost.h3q.com/software/jailaudit/ diff -ruN /usr/ports/ports-mgmt/jailaudit/pkg-plist freebsd-port/pkg-plist --- /usr/ports/ports-mgmt/jailaudit/pkg-plist 2014-02-14 11:01:37.000000000 +0100 +++ freebsd-port/pkg-plist 2014-08-05 12:02:31.225608011 +0200 @@ -1,7 +1,9 @@ bin/jailaudit %%ETCDIR%%.conf.sample %%PERIODICDIR%%/security/410.jailaudit +@exec install -d -o root -g wheel -m 755 %D/jailaudit/tmp @dirrmtry %%XTMPDIR%% +@exec install -d -o root -g wheel -m 755 %D/jailaudit/reports @dirrmtry %%REPORTDIR%% @dirrmtry jailaudit @dirrmtry %%PERIODICDIR%%/security
any way you can attach that patch - it's more convenient for a committer.
Created attachment 145388 [details] fix for the StageDir and old pkg issue fix the creation of report and tmp dir while supporting StageDir and installing with old pkg bump port revision to 1
That was quick. :)
applied patch, made sure /usr/local/jailaudit/tmp didn't exist, ran "portmaster ports-mgmt/jailaudit" and the error has gone away for me also % jailaudit generate - ALL Downloading a current audit database: auditfile.tbz 100% of 96 kB 177 kBps 00m01s New database installed. Database created: Tue Aug 5 11:10:00 BST 2014 %
A commit references this bug: Author: marino Date: Thu Aug 7 10:17:21 UTC 2014 New revision: 364258 URL: http://svnweb.freebsd.org/changeset/ports/364258 Log: ports-mgmt/jailaudit: precreate two directories to fix launch issue PR: 192396 Submitted by: Gary (freebsd-bugzilla in-addr.com) Fixed by: maintainer (Philipp Wuensche) Changes: head/ports-mgmt/jailaudit/Makefile head/ports-mgmt/jailaudit/pkg-plist
thanks!