AIDE; 31_aide_apt; corrupt /var/lib/aide/aide.conf.autogenerated if '#' at the end of a sources.list line
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
aide (Ubuntu) |
Fix Released
|
High
|
Unassigned |
Bug Description
Binary package hint: aide
aide_0.13.1-5
Running aideinit or update-aide.conf will result in a corrupt /var/lib/
If sources.list has an '#' at the end of a line this '#' makes its way into /var/lib/
E.G.
following line in sources.list
deb http://
will give a line in /var/lib/
/var/lib/
Line is generated by /etc/aide/
TESTCASE
1. System > Administration > Software Sources (or run sudo software-
2. Add new sources.
a. Uncheck the "Source code" box on the first tab "Ubuntu software" if it is checked. Close, reload. If not checked, proceed to 2.b.
b. Open Software sources again, and now check the "Source code" box on the "Ubuntu software" tab. software-
#Added by software-properties
3. run 'sudo aideinit'
On failure, it will report:
100:syntax error:"
100:Error while reading configuration:"
Configuration error
On success, aideinit will run to completion (which will take a while)
Changed in aide: | |
status: | New → Confirmed |
description: | updated |
Changed in aide: | |
importance: | Undecided → High |
I can confirm the bug. To replicate the problem do the following:
1. System > Administration > Software Sources
2. Add new sources.
a. Uncheck the "Source code" box on the first tab "Ubuntu software" if it is checked. Close, reload. If not checked, proceed to 2.b.
b. Open Software sources again, and now check the "Source code" box on the "Ubuntu software" tab.
software- properties- gtk will add the following to any new lines it added to /etc/apt/ source. list:
#Added by software-properties
The short term workaround, until /etc/aide/ aide.conf. d/31_aide_ apt is fixed is to simply remove the offending comments from /etc/apt/ sources. list manually.
The long term fix is to correct 31_aide_apt by adding an sed statement which first strips the comments added by software- properties- gtk. I'm attaching a patch which I have tested, and works for me.
This is the text of the patch: [[:space: ]]/{s/[ ^[:space: ]]\+[[: space:] ]\+\([^ [:space: ]]\+\). */\1/p; q};')"
<begin text>
--- 31_aide_apt.old 2007-11-07 10:52:00.000000000 -0500
+++ 31_aide_apt 2007-11-07 10:47:57.000000000 -0500
@@ -18,7 +18,7 @@
APT_VERS="$(dpkg --status apt | sed -n '/^Version:
fi
-cat $SOURCESLIST | while read deb uri dist comp; do :]\+\). *|\1|') " \([^/[: space:] ]\+\).* |\1|')"
+cat $SOURCESLIST | sed 's/ #.*$//' | while read deb uri dist comp; do
PROTOCOL="$(echo $uri | sed 's|\([^
if [ "$PROTOCOL" = "http" ] || [ "$PROTOCOL" = "ftp" ]; then
HOST="$(echo $uri | sed 's|.*//
<end text>
Best regards,
Harvey