From 821adb94316c853dfa2b03c883a1be232fbccdab Mon Sep 17 00:00:00 2001 From: Daniel Drake Date: Thu, 7 Mar 2013 16:12:39 -0600 Subject: [PATCH 1/2] Improve compat with old clients --- puppet.spec | 8 +++++- puppetmaster-old-client-compat.patch | 39 ++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 puppetmaster-old-client-compat.patch diff --git a/puppet.spec b/puppet.spec index 38e92c1..fed9e16 100644 --- a/puppet.spec +++ b/puppet.spec @@ -20,7 +20,7 @@ Name: puppet Version: 3.0.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A network tool for managing many disparate systems License: ASL 2.0 URL: http://puppetlabs.com @@ -28,6 +28,8 @@ Source0: http://downloads.puppetlabs.com/%{name}/%{name}-%{version}.tar.g Source1: http://downloads.puppetlabs.com/%{name}/%{name}-%{version}.tar.gz.asc Source2: puppet-nm-dispatcher +Patch0: puppetmaster-old-client-compat.patch + Group: System Environment/Base BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -103,6 +105,7 @@ The server can also function as a certificate authority and file server. %prep %setup -q +%patch0 -p1 patch -s -p1 < %{confdir}/rundir-perms.patch # Fix some rpmlint complaints @@ -349,6 +352,9 @@ fi rm -rf %{buildroot} %changelog +* Thu Mar 7 2013 Daniel Drake - 3.0.2-2 +- Improve server compatibility with old puppet clients (#831303) + * Tue Oct 30 2012 Moses Mendoza - 3.0.2-1 - Update to 3.0.2 - Update new dependencies (ruby >= 1.8.7, facter >= 1.6.6, hiera >= 1.0.0) diff --git a/puppetmaster-old-client-compat.patch b/puppetmaster-old-client-compat.patch new file mode 100644 index 0000000..95323a8 --- /dev/null +++ b/puppetmaster-old-client-compat.patch @@ -0,0 +1,39 @@ +From ec462b7b974fc34110437010f862780fb2ee39a3 Mon Sep 17 00:00:00 2001 +From: Daniel Drake +Date: Thu, 14 Feb 2013 15:05:10 -0600 +Subject: [PATCH] (#18781) Be more tolerant of old clients in WEBrick server + +In #18781 and #6117 there are cases of relatively simplistic puppet +setups failing between old versions of the puppet client (which +always use HTTP GET) and new versions of the puppet WEBrick server +(which has a relatively low limit on the size of a valid GET: 2083 +bytes). + +While there are other non-WEBrick server options available, WEBrick +has the advantage of simplicity, so it would be nice to keep it working. + +Here we patch the WEBrick constant which specifies the maximum size of +a HTTP GET request, increasing it to a value that should work for common +setups. +--- + lib/puppet/util/monkey_patches.rb | 9 +++++++++ + 1 file changed, 9 insertions(+) + +Index: puppet-3.0.2/lib/puppet/util/monkey_patches.rb +=================================================================== +--- puppet-3.0.2.orig/lib/puppet/util/monkey_patches.rb ++++ puppet-3.0.2/lib/puppet/util/monkey_patches.rb +@@ -310,3 +310,13 @@ if RUBY_VERSION == '1.8.5' + module_function :move + end + end ++ ++# Old puppet clients may make large GET requests, lets be reasonably tolerant ++# in our default WEBrick server. ++require 'webrick' ++if defined?(WEBrick::HTTPRequest::MAX_URI_LENGTH) and WEBrick::HTTPRequest::MAX_URI_LENGTH < 8192 ++ # Silence ruby warning: already initialized constant MAX_URI_LENGTH ++ v, $VERBOSE = $VERBOSE, nil ++ WEBrick::HTTPRequest.const_set("MAX_URI_LENGTH", 8192) ++ $VERBOSE = v ++end From 398854873ea95589bbf563d37122ae9eb55a655f Mon Sep 17 00:00:00 2001 From: Michael Stahnke Date: Thu, 7 Mar 2013 17:36:58 -0800 Subject: [PATCH 2/2] Update patch to 3.1.0 --- puppet.spec | 5 +++-- puppetmaster-old-client-compat.patch | 9 --------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/puppet.spec b/puppet.spec index 2bf80c0..b53af53 100644 --- a/puppet.spec +++ b/puppet.spec @@ -23,7 +23,7 @@ Name: puppet Version: 3.1.0 -Release: 3%{?dist} +Release: 4%{?dist} Summary: A network tool for managing many disparate systems License: ASL 2.0 URL: http://puppetlabs.com @@ -351,8 +351,9 @@ fi rm -rf %{buildroot} %changelog -* Thu Mar 07 2013 Michael Stahnke - 3.1.0-3 +* Thu Mar 07 2013 Michael Stahnke - 3.1.0-4 - Disable systemd in F18 as per bz#873853 +- Update Patch0 to work with 3.1 * Thu Mar 7 2013 Daniel Drake - 3.1.0-2 - Improve server compatibility with old puppet clients (#831303) diff --git a/puppetmaster-old-client-compat.patch b/puppetmaster-old-client-compat.patch index 4b88900..3787cde 100644 --- a/puppetmaster-old-client-compat.patch +++ b/puppetmaster-old-client-compat.patch @@ -19,21 +19,12 @@ setups. lib/puppet/util/monkey_patches.rb | 9 +++++++++ 1 file changed, 9 insertions(+) -<<<<<<< HEAD -Index: puppet-3.0.2/lib/puppet/util/monkey_patches.rb -=================================================================== ---- puppet-3.0.2.orig/lib/puppet/util/monkey_patches.rb -+++ puppet-3.0.2/lib/puppet/util/monkey_patches.rb -@@ -310,3 +310,13 @@ if RUBY_VERSION == '1.8.5' - module_function :move -======= Index: puppet-3.1.0/lib/puppet/util/monkey_patches.rb =================================================================== --- puppet-3.1.0.orig/lib/puppet/util/monkey_patches.rb +++ puppet-3.1.0/lib/puppet/util/monkey_patches.rb @@ -356,3 +356,13 @@ unless Dir.respond_to?(:mktmpdir) end ->>>>>>> master end end +