RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1266458 - aide can not handle directory name with spaces
Summary: aide can not handle directory name with spaces
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: aide
Version: 7.2
Hardware: All
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Daniel Kopeček
QA Contact: Karel Srot
URL:
Whiteboard:
Depends On:
Blocks: 1203710
TreeView+ depends on / blocked
 
Reported: 2015-09-25 10:43 UTC by Eva Mrakova
Modified: 2016-10-06 12:25 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 1180435
Environment:
Last Closed: 2016-10-06 12:25:04 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Eva Mrakova 2015-09-25 10:43:48 UTC
Also happens for
aide-0.15.1-9.el7.x86_64

just aide's message is slightly different (version is included):
----------
AIDE 0.15.1 found differences between database and filesystem!!
<snip>
----------

+++ This bug was initially created as a clone of Bug #1180435 +++

Description of problem:

The customer reported an odd behavior on aid with using space in directory name to indicate negative selection in aide.conf. It's reproducible on RHEL6 but not on RHEL7, so I believe it's a bug.

Package version:
aide-0.14-7.el6.x86_64
It's the latest in RHEL6 at this point.

Version-Release number of selected component (if applicable):

aide-0.14-7.el6.x86_64
(It's the latest in RHEL6 at this point.)

How reproducible:

100%

Steps to reproduce:

1. Edit /etc/aide.conf like:
----------
# tail -n2 /etc/aide.conf
/var/tmp/aidetest	NORMAL
!/var/tmp/aidetest/a\ 123456/x
----------

2. Create directory and file, and initialize db of aide.
# mkdir -p /var/tmp/aidetest/a\ 123456/x
# touch /var/tmp/aidetest/a\ 123456/x/foo
# aide -i && mv -f /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gz 

3. Modify the file.
# echo abc > /var/tmp/aidetest/a\ 123456/x/foo 

4. Check intrusion.
# aide

Actual results:

aide detects differences.
----------
AIDE found differences between database and filesystem!!
<snip>
----------

Expected results:

aide ignores the differences because the modification was described in aide.conf should be ignored.
----------
<snip>
### All files match AIDE database. Looks okay!
<snip>
----------

Additional info:

If you use shorter directory name than 'a\ 123456' or omit sub-directory 'x', it's unlikely the phenomenon is happened.

However, on RHEL7, it works as expected. Also, I found a difference in db on both of RHEL6 and 7.

RHEL6:
# zcat /var/lib/aide/aide.db.gz | grep ^/var | awk '{print $1}' | sort
/var/tmp/aidetest
/var/tmp/aidetest/a%20123456
/var/tmp/aidetest/a%20123456/x
/var/tmp/aidetest/a%20123456/x/foo

RHEL7:
# zcat /var/lib/aide/aide.db.gz | grep ^/var | awk '{print $1}' | sort
/var/tmp/aidetest
/var/tmp/aidetest/a%20123456

I guess that the difference of db contents caused the behavior.


--- Additional comment from Masayoshi Yamazaki on 2015-01-26 04:38:12 CET ---

Here is an upstream patch.
http://sourceforge.net/p/aide/mailman/aide-commits/thread/E1OKuEa-0002VC-M0@sfp-scmshell-3.v30.ch3.sourceforge.com/
commit fe927b27277cbdc2f05fd1373f8d8390754e8c31

Comment 3 Daniel Kopeček 2016-06-22 14:02:44 UTC
Hi Eva, how did you reproduce this issue? I finally got to processing aide bugs and I found out that the patch from 6.8 is already applied to the 0.15.1 codebase. I tried to reproduce the issue but I don't see it with my setup (testing on rhel-7.2). Did you follow a different steps to reproduce the issue?

This is what I did:

# mkdir -p /var/tmp/aidetest/a\ 123456/x
# touch /var/tmp/aidetest/a\ 123456/x/foo
# aide -i && mv -f /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gz 

AIDE, version 0.15.1

### AIDE database at /var/lib/aide/aide.db.new.gz initialized.

# aide

AIDE, version 0.15.1

### All files match AIDE database. Looks okay!

# echo abc > /var/tmp/aidetest/a\ 123456/x/foo
# aide

AIDE, version 0.15.1

### All files match AIDE database. Looks okay!

# tail -n2 /etc/aide.conf 
/var/tmp/aidetest	NORMAL
!/var/tmp/aidetest/a\ 123456/x

Comment 4 Karel Srot 2016-06-22 14:35:25 UTC
Hi Dan,
we are able to reproduce the problem and it seems to be quite sensitive on directory names. E.g. if I remember properly, I wasn't able to reproduce it with a directory name where the space was as the 2nd letter. In our test we are using path /tmp/tmp.kds9esUgmy/dir\ bz1180435/subdir/tstfile.

Comment 6 Karel Srot 2016-06-22 14:39:58 UTC
I will run the test case again to find out the current status and report the result.

Comment 7 Daniel Kopeček 2016-06-22 15:06:55 UTC
(In reply to Karel Srot from comment #4)
> Hi Dan,
> we are able to reproduce the problem and it seems to be quite sensitive on
> directory names. E.g. if I remember properly, I wasn't able to reproduce it
> with a directory name where the space was as the 2nd letter. In our test we
> are using path /tmp/tmp.kds9esUgmy/dir\ bz1180435/subdir/tstfile.

Hmm. So I tested it with the space at position 4.

# mkdir -p /var/tmp/aidetest/abc\ 123456/x
# touch /var/tmp/aidetest/abc\ 123456/x/foo
# aide -i && mv -f /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gz

AIDE, version 0.15.1

### AIDE database at /var/lib/aide/aide.db.new.gz initialized.

# aide

AIDE, version 0.15.1

### All files match AIDE database. Looks okay!

# echo abc > /var/tmp/aidetest/abc\ 123456/x/foo
# aide

AIDE, version 0.15.1

### All files match AIDE database. Looks okay!

# tail -n2 /etc/aide.conf 
/var/tmp/aidetest	NORMAL
!/var/tmp/aidetest/abc\ 123456/x


---------- snip -----------

and position 3 (to check some odd numbers too)...:

---------- snip -----------

# mkdir -p /var/tmp/aidetest/ab\ 123456/x
# touch /var/tmp/aidetest/ab\ 123456/x/foo
# aide -i && mv -f /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gz

AIDE, version 0.15.1

### AIDE database at /var/lib/aide/aide.db.new.gz initialized.

# aide

AIDE, version 0.15.1

### All files match AIDE database. Looks okay!

# echo abc > /var/tmp/aidetest/ab\ 123456/x/foo
# aide

AIDE, version 0.15.1

### All files match AIDE database. Looks okay!

# tail -n2 /etc/aide.conf 
/var/tmp/aidetest	NORMAL
!/var/tmp/aidetest/ab\ 123456/x

---------- snip -----------

If you could compile some clear steps to reproduce, that would be great!

Comment 13 Karel Srot 2016-10-06 12:25:04 UTC
I am closing the bug as the fix is already present and we cannot reproduce the issue on recent RHEL releases.


Note You need to log in before you can comment on or make changes to this bug.