/[gentoo-x86]/net-misc/apt-cacher-ng/files/apt-cacher-ng-0.7.26-CVE-2014-4510.patch
Gentoo

Contents of /net-misc/apt-cacher-ng/files/apt-cacher-ng-0.7.26-CVE-2014-4510.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Tue Sep 9 16:26:18 2014 UTC (4 years, 5 months ago) by jer
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
FILE REMOVED
Old.

(Portage version: 2.2.12/cvs/Linux x86_64, signed Manifest commit with key A792A613)

1 From 6f08e6a3995d1bed4e837889a3945b6dc650f6ad Mon Sep 17 00:00:00 2001
2 From: Eduard Bloch <blade@debian.org>
3 Date: Thu, 19 Jun 2014 23:10:28 +0200
4 Subject: [PATCH 1/1] Option to have a custom message body
5
6 ---
7 include/job.h | 2 +-
8 source/job.cc | 15 +++++++++------
9 2 files changed, 10 insertions(+), 7 deletions(-)
10
11 diff --git a/include/job.h b/include/job.h
12 index 9724590..e2026ac 100644
13 --- a/include/job.h
14 +++ b/include/job.h
15 @@ -76,7 +76,7 @@ class job {
16
17 const char * BuildAndEnqueHeader(const fileitem::FiStatus &fistate, const off_t &nGooddataSize, header& respHead);
18 fileitem::FiStatus _SwitchToPtItem(const mstring &fileLoc);
19 - void SetErrorResponse(const char * errorLine, const char *szLocation=NULL);
20 + void SetErrorResponse(const char * errorLine, const char *szLocation=NULL, const char *bodytext=NULL);
21 void HandleLocalDownload(const mstring &visPath,
22 const mstring &fsBase, const mstring &fsSubpath);
23
24 diff --git a/source/job.cc b/source/job.cc
25 index 53168d2..293d34b 100644
26 --- a/source/job.cc
27 +++ b/source/job.cc
28 @@ -729,7 +729,8 @@ report_overload:
29 return ;
30
31 report_notallowed:
32 - SetErrorResponse((tSS() << "403 Forbidden file type or location: " << sReqPath).c_str());
33 + SetErrorResponse((tSS() << "403 Forbidden file type or location: " << sReqPath).c_str(),
34 + NULL, "403 Forbidden file type or location");
35 // USRDBG( sRawUriPath + " -- ACCESS FORBIDDEN");
36 return ;
37
38 @@ -1156,26 +1157,28 @@ fileitem::FiStatus job::_SwitchToPtItem(const std::string &fileLoc)
39 }
40
41
42 -void job::SetErrorResponse(const char * errorLine, const char *szLocation)
43 +void job::SetErrorResponse(const char * errorLine, const char *szLocation, const char *bodytext)
44 {
45 LOGSTART2("job::SetErrorResponse", errorLine << " ; for " << m_sOrigUrl);
46 class erroritem: public tGeneratedFitemBase
47 {
48 public:
49 - erroritem(const string &sId, const char *szError) : tGeneratedFitemBase(sId, szError)
50 + erroritem(const string &sId, const char *szError, const char *bodytext)
51 + : tGeneratedFitemBase(sId, szError)
52 {
53 if(BODYFREECODE(m_head.getStatus()))
54 return;
55 // otherwise do something meaningful
56 m_data << "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n"
57 - "<html><head><title>" << szError << "</title>\n</head>\n<body><h1>"
58 - << szError << "</h1></body></html>";
59 + "<html><head><title>" << (bodytext ? bodytext : szError)
60 + << "</title>\n</head>\n<body><h1>"
61 + << (bodytext ? bodytext : szError) << "</h1></body></html>";
62 m_head.set(header::CONTENT_TYPE, "text/html");
63 seal();
64 }
65 };
66
67 - erroritem *p = new erroritem("noid", errorLine);
68 + erroritem *p = new erroritem("noid", errorLine, bodytext);
69 p->HeadRef().set(header::LOCATION, szLocation);
70 m_pItem.ReplaceWithLocal(p);
71 //aclog::err(tSS() << "fileitem is now " << uintptr_t(m_pItem.get()));
72 --
73 1.9.1
74

  ViewVC Help
Powered by ViewVC 1.1.20