[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[SCM] Debian package checker branch, wheezy, updated. 2.5.10.4-15-ge0dc594



The following commit has been merged in the wheezy branch:
commit bd50cbabc708fd38691d36e32e4c0d20e03d9489
Author: Niels Thykier <niels@thykier.net>
Date:   Thu Apr 4 23:33:42 2013 +0200

    c/init.d: Guard against possible symlink traversals
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/checks/init.d b/checks/init.d
index 86d9985..abab5df 100644
--- a/checks/init.d
+++ b/checks/init.d
@@ -88,7 +88,9 @@ my $action_r = qr/\w+/;
 my $exclude_r = qr/if\s+\[\s+-x\s+\S*update-rc\.d/;
 
 # read postinst control file
-if (open(IN, '<', $postinst)) {
+if ( -f $postinst and not -l $postinst) {
+    open(IN, '<', $postinst)
+        or fail "open postinst: $!";
     while (<IN>) {
         next if /$exclude_r/o;
         s/\#.*$//o;
@@ -104,11 +106,13 @@ if (open(IN, '<', $postinst)) {
             tag 'output-of-updaterc.d-not-redirected-to-dev-null', "$name postinst";
         }
     }
+    close(IN);
 }
-close(IN);
 
 # read preinst control file
-if (open(IN, '<', $preinst)) {
+if ( -f $preinst and not -l $preinst) {
+    open(IN, '<', $preinst)
+        or fail "open preinst: $!";
     while (<IN>) {
         next if /$exclude_r/o;
         s/\#.*$//o;
@@ -123,7 +127,9 @@ if (open(IN, '<', $preinst)) {
 }
 
 # read postrm control file
-if (open(IN, '<', $postrm)) {
+if ( -f $postrm and not -l $postrm) {
+    open(IN, '<', $postrm)
+        or fail "open postrm: $!";
     while (<IN>) {
         next if /$exclude_r/o;
         s/\#.*$//o;
@@ -140,7 +146,9 @@ if (open(IN, '<', $postrm)) {
 }
 
 # read prerm control file
-if (open(IN, '<', $prerm)) {
+if ( -f $prerm and not -l $prerm) {
+    open(IN, '<', $prerm)
+        or fail "open prerm: $!";
     while (<IN>) {
         next if /$exclude_r/o;
         s/\#.*$//o;
diff --git a/debian/changelog b/debian/changelog
index e23cda2..c3d20b6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,9 @@ lintian (2.5.10.5) unstable; urgency=low
   * checks/debconf:
     + [NT] Fix several path traversal issues that could leak
       information about the host system.
+  * checks/init.d:
+    + [NT] Fix possible symlink traversal that could leak
+      information about the host system.
   * checks/md5sums:
     + [NT] Fix path traversal issue that could leak information
       about the host system.

-- 
Debian package checker


Reply to: