diff options
author | Benjamin Kellermann <Benjamin.Kellermann@gmx.de> | 2009-06-08 11:17:32 +0200 |
---|---|---|
committer | Benjamin Kellermann <Benjamin.Kellermann@gmx.de> | 2009-06-08 11:17:32 +0200 |
commit | 8d39350677660d114502ceb48bd067c74339ece3 (patch) | |
tree | 3375a498f59b9ec33317a3eca99f48f76f769f37 | |
parent | 71648b733395713000b5016e6319b5df14fdc634 (diff) |
Security bugfix: bzr.rb could be exploited
-rw-r--r-- | bzr.rb | 4 | ||||
-rwxr-xr-x | config.cgi | 7 | ||||
-rw-r--r-- | participate.rb | 2 |
3 files changed, 4 insertions, 9 deletions
@@ -13,7 +13,7 @@ class VCS end def VCS.cat revision, file - `#{BZRCMD} cat -r #{revision} #{file}` + `#{BZRCMD} cat -r #{revision.to_i} #{file}` end def VCS.history @@ -21,6 +21,6 @@ class VCS end def VCS.commit comment - `#{BZRCMD} commit -m '#{comment}'` + `#{BZRCMD} commit -m \"#{comment}\"` end end @@ -33,12 +33,7 @@ require "poll" require "datepoll" Dir.chdir(olddir) -if $cgi.include?("revision") - REVISION=$cgi["revision"].to_i - table = YAML::load(VCS.cat(REVISION, "data.yaml")) -else - table = YAML::load_file("data.yaml") -end +table = YAML::load_file("data.yaml") $htmlout = <<HTMLHEAD <head> diff --git a/participate.rb b/participate.rb index 744f157..2fd057e 100644 --- a/participate.rb +++ b/participate.rb @@ -11,7 +11,7 @@ require "datepoll" Dir.chdir(olddir) if $cgi.include?("revision") - REVISION=$cgi["revision"].to_i + REVISION=$cgi["revision"] table = YAML::load(VCS.cat(REVISION, "data.yaml")) else table = YAML::load_file("data.yaml") |