Bug 283166 - security/aide: failed to get ACL of ZFS files: Invalid argument
Summary: security/aide: failed to get ACL of ZFS files: Invalid argument
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Some People
Assignee: Cy Schubert
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-12-06 18:16 UTC by testcb00
Modified: 2025-02-14 14:31 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (cy)


Attachments
Add no-acl flavour. (1.36 KB, patch)
2024-12-06 18:33 UTC, Cy Schubert
no flags Details | Diff
Corrects package name. (1.36 KB, patch)
2024-12-06 22:52 UTC, Cy Schubert
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description testcb00 2024-12-06 18:16:09 UTC
1. The current build with the '--with-posix-acl' option causes problems on ZFS filesystem (default NFSv4 ACL). Refer to this post: https://forums.freebsd.org/threads/getfacl-invalid-argument.94485/

2. If the '--with-posix-acl' option is the default, can we have a flavor of 'aide-noposixacl', which builds without the option for use with ZFS filesystems?
Comment 1 Cy Schubert freebsd_committer freebsd_triage 2024-12-06 18:33:43 UTC
Created attachment 255670 [details]
Add no-acl flavour.

Add a no-acl flavour.

Please give this a spin.
Comment 2 testcb00 2024-12-06 20:23:21 UTC
(In reply to Cy Schubert from comment #1)

The patch should work. My procedure is:

1. Download the latest ports:
root@freebsd_test:~ # git clone --depth=1 -b main https://git.freebsd.org/ports.git /usr/ports

2. Save the patch:
root@freebsd_test:~ # ee /usr/ports/security/aide/files/0001-security-aide-Flavorize-and-add-a-without-ACL-flavor.patch

3. Apply the patch:
root@freebsd_test:~ # patch < /usr/ports/security/aide/files/0001-security-aide-Flavorize-and-add-a-without-ACL-flavor.patch

4. Use portmaster to install the flavor:
root@freebsd_test:~ # portmaster security/aide@without_acl

5. Update the config:
root@freebsd_test:~ # sed -i '' 's/database=/database_in=/g' /usr/local/etc/aide.conf

6. Initialize the AIDE database:
root@freebsd_test:~ # aide --init

7. Create a file to show the difference:
root@freebsd_test:~ # touch /usr/local/etc/test

8. Run AIDE:
root@freebsd_test:~ # aide

The "failed to get ACL" errors are gone.

However, the flavor name looks strange. pkg info shows aidewithout_acl instead of aide-without_acl.

Also, users may be confused as the name implies building without ACLs. I suggest updating the description to:

File and directory integrity checker (without POSIX ACLs)

root@freebsd_test:~ # pkg info
aidewithout_acl-0.18.6_1       File and directory integrity checker
Comment 3 Cy Schubert freebsd_committer freebsd_triage 2024-12-06 21:44:18 UTC
(In reply to testcb00 from comment #2)

Don't do this.

Here's the way to apply the patch. There are two ways to patch your ports.

If your ports is a git repo then,

cd /usr/ports
git apply the_saved_filename

If your ports are as distributed from install media, not a git repo, then,

cd /usr/ports
patch -C -p1 < the_saved_filename && patch -p1 < the_saved_filename

To back out the patch when using git: git restore .

To back out the patch when using patch:

for I in find /usr/ports -name \*.orig; do mv $I $(echo $I | sed 's/\.orig$//'); done

The patch works here. What if I commit it and MFH it for you? All you would need to do is wait a week or two until the quarterly builds it, then pkg install aide-without_acl.
Comment 4 testcb00 2024-12-06 22:41:57 UTC
(In reply to Cy Schubert from comment #3)

Noted. I followed your guide (git) and it also worked, but the flavor name is still aidewithout_acl. Could my old method be causing the problem?
Comment 5 Cy Schubert freebsd_committer freebsd_triage 2024-12-06 22:52:34 UTC
Created attachment 255676 [details]
Corrects package name.

Oops. I screwed up. Attached is a new patch.
Comment 6 testcb00 2024-12-06 22:58:03 UTC
(In reply to Cy Schubert from comment #5)

This works. Now the name is aide-without_acl-0.18.6_1. Thank you.
Comment 7 Cy Schubert freebsd_committer freebsd_triage 2024-12-06 23:04:27 UTC
(In reply to testcb00 from comment #6)

Give it a few days. I will commit this patch if I don't hear from you (in this PR) about any issues by Tuesday.
Comment 8 commit-hook freebsd_committer freebsd_triage 2024-12-12 20:41:16 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=7b20f87790b64c5e3c068c4ab055f5f9758db0b7

commit 7b20f87790b64c5e3c068c4ab055f5f9758db0b7
Author:     Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2024-12-05 00:31:21 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2024-12-12 20:39:51 +0000

    security/aide: Flavorize and add a without ACL flavor

    ZFS supports NFSv4 ACLs and UFS can optionally support them. UFS doesn't
    by default support ACLs unless specifically enabled.

    The default remains as before.

    PR:             283166

 security/aide/Makefile | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)