[kde-services-devel] r509 - trunk/commitfilter/rules

josef at new.kstuff.org josef at new.kstuff.org
Sun Apr 19 15:05:27 CEST 2009


Author: josef
Date: 2009-04-19 15:05:26 +0200 (Sun, 19 Apr 2009)
New Revision: 509

Added:
   trunk/commitfilter/rules/exploit.xml
   trunk/commitfilter/rules/kubuntu-l10n.xml
Modified:
   trunk/commitfilter/rules/cia2eximfilter
Log:
- proper Exim filter rule generation
- addition of planned Kubuntu rules



Modified: trunk/commitfilter/rules/cia2eximfilter
===================================================================
--- trunk/commitfilter/rules/cia2eximfilter	2009-04-19 12:43:54 UTC (rev 508)
+++ trunk/commitfilter/rules/cia2eximfilter	2009-04-19 13:05:26 UTC (rev 509)
@@ -79,7 +79,8 @@
 		end
 		exitems_not = []
 		exitems.each do |exitem|
-			exitems_not << "not#{exitem}"
+			#exitems_not << "not#{exitem}"
+			exitems_not << exitem.gsub(/contains/, "does not contain")
 		end
 		return exitems_not
 	end
@@ -88,14 +89,16 @@
 		exitems = []
 		items.each do |item|
 			path = item.attributes["path"]
-			match = (item/"text()").to_s.strip
+			match = (item/"text()").to_s.strip.gsub(/\\/, "\\\\\\\\").gsub(/"/, "\\\"")
 			case path
 				when "author":
-					exitems << "(author = '#{match}')"
+					#exitems << "(author = '#{match}')"
+					exitems << "($header_from: contains \"#{match}\")"
 				when "url":
-					exitems << "(url = '#{match}')"
-				when "project":
-					exitems << "(project = '#{match}')"
+					#exitems << "(url = '#{match}')"
+					exitems << "($header_x-commit-directories: contains \"#{match}\")"
+				#when "project":
+				#	exitems << "(project = '#{match}')"
 				else
 					#raise "BLARGH #{path}"
 					# ignore...
@@ -115,6 +118,6 @@
 
 	c2e = CIA2Exim.new
 	str = c2e.convert(doc)
-	puts str
+	puts "if(" + str + ")"
 end
 

Added: trunk/commitfilter/rules/exploit.xml
===================================================================
--- trunk/commitfilter/rules/exploit.xml	                        (rev 0)
+++ trunk/commitfilter/rules/exploit.xml	2009-04-19 13:05:26 UTC (rev 509)
@@ -0,0 +1,7 @@
+<and>
+  <!-- SQL quoting -->
+  <match path="url">'; DROP TABLE</match>
+
+  <!-- Exim quoting -->
+  <not><match path="author">"'\</match></not>
+</and>

Added: trunk/commitfilter/rules/kubuntu-l10n.xml
===================================================================
--- trunk/commitfilter/rules/kubuntu-l10n.xml	                        (rev 0)
+++ trunk/commitfilter/rules/kubuntu-l10n.xml	2009-04-19 13:05:26 UTC (rev 509)
@@ -0,0 +1,7 @@
+<and>
+  <!-- Include all l10n commits on the KDE 4.x stable branch -->
+  <match path="url">/branches/stable/l10n-kde4/templates</match>
+
+  <!-- But exclude scripty commits (Script Kiddy uses sysadmin identity) -->
+  <not><match path="author">sysadmin at kde.org</match></not>
+</and>



More information about the kde-services-devel mailing list