jer         14/06/24 13:20:47

  Added:                apt-cacher-ng-0.7.26-CVE-2014-4510.patch
  Log:
  Add patch for CVE-2014-4510 (bug #514184).
  
  (Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key 
A792A613)

Revision  Changes    Path
1.1                  
net-misc/apt-cacher-ng/files/apt-cacher-ng-0.7.26-CVE-2014-4510.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/apt-cacher-ng/files/apt-cacher-ng-0.7.26-CVE-2014-4510.patch?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/apt-cacher-ng/files/apt-cacher-ng-0.7.26-CVE-2014-4510.patch?rev=1.1&content-type=text/plain

Index: apt-cacher-ng-0.7.26-CVE-2014-4510.patch
===================================================================
>From 6f08e6a3995d1bed4e837889a3945b6dc650f6ad Mon Sep 17 00:00:00 2001
From: Eduard Bloch <[email protected]>
Date: Thu, 19 Jun 2014 23:10:28 +0200
Subject: [PATCH 1/1] Option to have a custom message body

---
 include/job.h |  2 +-
 source/job.cc | 15 +++++++++------
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/include/job.h b/include/job.h
index 9724590..e2026ac 100644
--- a/include/job.h
+++ b/include/job.h
@@ -76,7 +76,7 @@ class job {
 
       const char * BuildAndEnqueHeader(const fileitem::FiStatus &fistate, 
const off_t &nGooddataSize, header& respHead);
       fileitem::FiStatus _SwitchToPtItem(const mstring &fileLoc);
-      void SetErrorResponse(const char * errorLine, const char 
*szLocation=NULL);
+      void SetErrorResponse(const char * errorLine, const char 
*szLocation=NULL, const char *bodytext=NULL);
       void HandleLocalDownload(const mstring &visPath,
                        const mstring &fsBase, const mstring &fsSubpath);
 
diff --git a/source/job.cc b/source/job.cc
index 53168d2..293d34b 100644
--- a/source/job.cc
+++ b/source/job.cc
@@ -729,7 +729,8 @@ report_overload:
     return ;
 
 report_notallowed:
-       SetErrorResponse((tSS() << "403 Forbidden file type or location: " << 
sReqPath).c_str());
+       SetErrorResponse((tSS() << "403 Forbidden file type or location: " << 
sReqPath).c_str(),
+                       NULL, "403 Forbidden file type or location");
 //    USRDBG( sRawUriPath + " -- ACCESS FORBIDDEN");
     return ;
 
@@ -1156,26 +1157,28 @@ fileitem::FiStatus job::_SwitchToPtItem(const 
std::string &fileLoc)
 }
 
 
-void job::SetErrorResponse(const char * errorLine, const char *szLocation)
+void job::SetErrorResponse(const char * errorLine, const char *szLocation, 
const char *bodytext)
 {
        LOGSTART2("job::SetErrorResponse", errorLine << " ; for " << 
m_sOrigUrl);
        class erroritem: public tGeneratedFitemBase
        {
        public:
-               erroritem(const string &sId, const char *szError) : 
tGeneratedFitemBase(sId, szError)
+               erroritem(const string &sId, const char *szError, const char 
*bodytext)
+                       : tGeneratedFitemBase(sId, szError)
                {
                        if(BODYFREECODE(m_head.getStatus()))
                                return;
                        // otherwise do something meaningful
                        m_data << "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 
2.0//EN\">\n"
-                               "<html><head><title>" << szError << 
"</title>\n</head>\n<body><h1>"
-                               << szError << "</h1></body></html>";
+                               "<html><head><title>" << (bodytext ? bodytext : 
szError)
+                               << "</title>\n</head>\n<body><h1>"
+                               << (bodytext ? bodytext : szError) << 
"</h1></body></html>";
                        m_head.set(header::CONTENT_TYPE, "text/html");
                        seal();
                }
        };
 
-       erroritem *p = new erroritem("noid", errorLine);
+       erroritem *p = new erroritem("noid", errorLine, bodytext);
        p->HeadRef().set(header::LOCATION, szLocation);
        m_pItem.ReplaceWithLocal(p);
        //aclog::err(tSS() << "fileitem is now " << uintptr_t(m_pItem.get()));
-- 
1.9.1





Reply via email to