Public bug reported:

Description:    Ubuntu 14.04.1 LTS
Release:        14.04
aide:
  Installed: 0.16~a2.git20130520-2
  Candidate: 0.16~a2.git20130520-2
  Version table:
 *** 0.16~a2.git20130520-2 0
        500 http://dk.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
        100 /var/lib/dpkg/status

Comments in /etc/apt/sources.list and the .list files in
/etc/apt/sources.list.d are not handled correctly. Lines starting with a
# are not ignored, sometimes causing an aide configuration file with
syntax errors to be generated. Also files that would be ignored by apt
are processed. The following patch should correct these issues. It
doesn't handle symbolic links in /etc/apt/sources.list.d. I don't know
if that's allowed.

diff -Naur /etc/aide/aide.conf.d.orig/31_aide_apt 
/etc/aide/aide.conf.d/31_aide_apt
--- /etc/aide/aide.conf.d.orig/31_aide_apt      2013-12-16 20:13:51.000000000 
+0100
+++ /etc/aide/aide.conf.d/31_aide_apt   2014-09-24 09:30:49.596317811 +0200
@@ -20,7 +20,7 @@

 echo '@@define TRANSLATIONS
(ca|cs|da|de|de_DE|en|eo|es|eu|fi|fr|hr|hu|id|it|ja|km|ko|nb|nl|pl|pt|pt_BR|ro|ru|sk|sr|sv|uk|vi|zh|zh_CN|zh_TW)'

-cat $SOURCESLIST /dev/null | sed 's/ #.*$//' | while read deb uri dist comp; do
+cat $SOURCESLIST /dev/null | sed 's/[:space:]*#.*$//; /^$/d' | while read deb 
uri dist comp; do
   PROTOCOL="$(echo $uri | sed 's|\([^:]\+\).*|\1|')"
   if [ "$PROTOCOL" = "http" ] || [ "$PROTOCOL" = "ftp" ]; then
     HOST="$(echo $uri | sed -e 's|.*//\([^/[:space:]]\+\).*|\1|' -e 
's|\.|\\\.|g')"
diff -Naur /etc/aide/aide.conf.d.orig/31_aide_apt-file 
/etc/aide/aide.conf.d/31_aide_apt-file
--- /etc/aide/aide.conf.d.orig/31_aide_apt-file 2013-12-16 20:13:51.000000000 
+0100
+++ /etc/aide/aide.conf.d/31_aide_apt-file      2014-09-24 09:30:51.396295358 
+0200
@@ -2,7 +2,7 @@

 . "$UPAC_settingsd/10_aide_sourceslist"

-cat $SOURCESLIST /dev/null | sed 's/ #.*$//' | while read deb uri dist comp; do
+cat $SOURCESLIST /dev/null | sed 's/[:space:]*#.*$//; /^$/d' | while read deb 
uri dist comp; do
     PROTOCOL="$(echo $uri | sed 's|\([^:]\+\).*|\1|')"
     HOST="$(echo $uri | sed -e 's|.*//\([^/[:space:]]\+\).*|\1|' -e 
's|\.|\\\.|g')"
     HOSTPATH="$(echo $uri | sed -e 
's|.*//[^/[:space:]]\+/\?||;s|/$||;s|/|_|g;s|^\(.\+\)$|_\1|' -e 's|\.|\\\.|g')"
diff -Naur /etc/aide/aide.settings.d.orig/10_aide_sourceslist 
/etc/aide/aide.settings.d/10_aide_sourceslist
--- /etc/aide/aide.settings.d.orig/10_aide_sourceslist  2013-12-16 
20:13:51.000000000 +0100
+++ /etc/aide/aide.settings.d/10_aide_sourceslist       2014-09-24 
10:21:53.206283457 +0200
@@ -5,8 +5,6 @@
   SOURCESLIST="/etc/apt/sources.list"
 fi

-for file in /etc/apt/sources.list.d/*; do
-  if [ -e "$file" ]; then
-    SOURCESLIST="$SOURCESLIST $file"
-  fi
+for file in $(find /etc/apt/sources.list.d -maxdepth 1 -type f -regex 
'^/etc/apt/sources.list.d/[a-zA-Z0-9_.-]*\.list$'); do
+  SOURCESLIST="$SOURCESLIST $file"
 done

** Affects: aide (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1373325

Title:
  Better handling of comments in /etc/apt/sources.list and
  /etc/apt/sources.lists.d/*

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/aide/+bug/1373325/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to