AIDE; 31_aide_apt; corrupt /var/lib/aide/aide.conf.autogenerated if '#' at the end of a sources.list line

Bug #112242 reported by Thomas Templin on 2007-05-04
16
Affects Status Importance Assigned to Milestone
aide (Ubuntu)
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/aide/aide.conf.autogenerated.

If sources.list has an '#' at the end of a line this '#' makes its way into /var/lib/aide/aide.conf.autogenerated.
E.G.
following line in sources.list
 deb http://archive.canonical.com/ubuntu feisty-commercial main # Ubuntu Commercial Applications; Feisty

will give a line in /var/lib/aide/aide.conf.autogenerated:
 /var/lib/apt/lists/archive.canonical.com_ubuntu_dists_feisty-commercial_#_binary-@@{ARCH}_Packages(\.IndexDiff)?$ VarFile

Line is generated by /etc/aide/aide.conf.d/31_aide_apt

TESTCASE
1. System > Administration > Software Sources (or run sudo software-properties-gtk)
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
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)

Harvey Muller (hlmuller) wrote :

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:
<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:[[:space:]]/{s/[^[:space:]]\+[[:space:]]\+\([^[:space:]]\+\).*/\1/p;q};')"
 fi

-cat $SOURCESLIST | while read deb uri dist comp; do
+cat $SOURCESLIST | sed 's/ #.*$//' | while read deb uri dist comp; do
   PROTOCOL="$(echo $uri | sed 's|\([^:]\+\).*|\1|')"
   if [ "$PROTOCOL" = "http" ] || [ "$PROTOCOL" = "ftp" ]; then
     HOST="$(echo $uri | sed 's|.*//\([^/[:space:]]\+\).*|\1|')"
<end text>

Best regards,

Harvey

Harvey Muller (hlmuller) on 2007-12-12
Changed in aide:
status: New → Confirmed
Jean-Baptiste Lallement (jibel) wrote :

Thanks for your help. Here is a debdiff against 0.13.1-10 (intrepid) for this fix.
Subscribing u-m-s for sponsorship.

Steve Beattie (sbeattie) on 2008-08-29
description: updated
Bryce Harrington (bryce) on 2008-11-03
Changed in aide:
importance: Undecided → High
Steve Langasek (vorlon) wrote :

Thanks Jean-Baptiste, the patch looks good - sponsorship on its way.

One problem I notice with 0.13.1-10ubuntu1 (that your previous sponsor should have caught) is that the maintainer field in debian/control isn't pointing to an ubuntu.com address. I've corrected this locally for the upload.

Will you submit this patch to the Debian maintainers (as well as your previous patch if you haven't already done so), so that a future version of aide can be synced again from Debian?

Steve Langasek (vorlon) wrote :

oh - scratch my comment about the maintainer field, I see that your latest patch /does/ fix that, so you already noticed the problem :)

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package aide - 0.13.1-10ubuntu2

---------------
aide (0.13.1-10ubuntu2) jaunty; urgency=low

  [ Jean-Baptiste Lallement ]
  * Fix 31_aide_apt to remove comments from source.list (LP: #112242)
  * debian/control: change Maintainer field

 -- Jean-Baptiste Lallement <email address hidden> Wed, 26 Nov 2008 19:52:15 +0000

Changed in aide:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers