[packages/snmptt] patch: Untaint the command before calling system()

jajcus jajcus at pld-linux.org
Sun Dec 2 16:12:55 CET 2012


commit 600fbebd56b40f1b46e24ca85b73bf2de7b92a7f
Author: Jacek Konieczny <jajcus at jajcus.net>
Date:   Sun Dec 2 16:09:49 2012 +0100

    patch: Untaint the command before calling system()
    
    snmptt would fail on the first EXEC to be run

 snmptt-exec.patch | 21 +++++++++++++++++++++
 snmptt.spec       |  2 ++
 2 files changed, 23 insertions(+)
---
diff --git a/snmptt.spec b/snmptt.spec
index 7640cea..b558db2 100644
--- a/snmptt.spec
+++ b/snmptt.spec
@@ -16,6 +16,7 @@ Source2:	%{name}.service
 Source3:	%{name}.logrotate
 Patch0:		%{name}-privileges.patch
 Patch1:		%{name}-unlink.patch
+Patch2:		%{name}-system.patch
 URL:		http://www.snmptt.org/
 BuildRequires:	rpmbuild(macros) >= 1.644
 BuildRequires:	rpm-perlprov
@@ -67,6 +68,7 @@ Pliki i zależności potrzebne do używania SNMPTT jako demona.
 %setup -q -n %{name}_%{version}
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
 
 %install
 rm -rf $RPM_BUILD_ROOT
diff --git a/snmptt-exec.patch b/snmptt-exec.patch
new file mode 100644
index 0000000..6b74a9b
--- /dev/null
+++ b/snmptt-exec.patch
@@ -0,0 +1,21 @@
+diff -dur snmptt_1.3.orig/snmptt snmptt_1.3/snmptt
+--- snmptt_1.3.orig/snmptt	2012-12-02 16:05:28.000000000 +0100
++++ snmptt_1.3/snmptt	2012-12-02 16:07:58.065741192 +0100
+@@ -2074,6 +2074,8 @@
+                   {
+                     print "EXECing command in thread:$command\n";
+                   }
++		  $command =~ /^(.*)$/;
++		  $command = $1;
+                   system $command;
+                   $thread_exec_semaphore->up;
+                 }
+@@ -2084,6 +2086,8 @@
+                   $command =~ s/\*/\\\*/g;
+                   $command =~ s/\?/\\\?/g;
+                 }
++		$command =~ /^(.*)$/;
++		$command = $1;
+                 system $command;
+               }
+             }
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/snmptt.git/commitdiff/aa14eb5f17b6822fbe030578110d91f2275572b6



More information about the pld-cvs-commit mailing list