Bug 192396 - ports-mgmt/jailaudit: cannot create /usr/local/jailaudit/tmp/_jailaudit_allports: No such file or directory
Summary: ports-mgmt/jailaudit: cannot create /usr/local/jailaudit/tmp/_jailaudit_allpo...
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: John Marino
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-05 08:52 UTC by Gary
Modified: 2014-08-07 10:18 UTC (History)
2 users (show)

See Also:


Attachments
fix for the StageDir and old pkg issue (1.04 KB, patch)
2014-08-05 10:06 UTC, Philipp Wuensche
cryx-ports: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gary 2014-08-05 08:52:36 UTC
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.
Comment 1 Philipp Wuensche 2014-08-05 09:09:26 UTC
(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?
Comment 2 Gary 2014-08-05 09:10:43 UTC
% 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
%
Comment 3 John Marino freebsd_committer freebsd_triage 2014-08-05 09:12:38 UTC
maintainer in CC already
Comment 4 Philipp Wuensche 2014-08-05 09:25:12 UTC
(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.
Comment 5 Philipp Wuensche 2014-08-05 10:03:55 UTC
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
Comment 6 John Marino freebsd_committer freebsd_triage 2014-08-05 10:06:00 UTC
any way you can attach that patch - it's more convenient for a committer.
Comment 7 Philipp Wuensche 2014-08-05 10:06:09 UTC
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
Comment 8 John Marino freebsd_committer freebsd_triage 2014-08-05 10:07:23 UTC
That was quick. :)
Comment 9 Gary 2014-08-05 10:16:16 UTC
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

%
Comment 10 commit-hook freebsd_committer freebsd_triage 2014-08-07 10:18:18 UTC
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
Comment 11 John Marino freebsd_committer freebsd_triage 2014-08-07 10:18:56 UTC
thanks!