Add patch by Kathy Miniutti of BBN to avoid choking on #NNN where NNN

is not a valid ticket number.
This commit is contained in:
Greg Troxel 2010-06-10 14:45:05 +00:00 committed by Thomas Klausner
parent 04f931a5bf
commit efdd3e19be
3 changed files with 29 additions and 2 deletions

View file

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.3 2009/08/04 18:29:09 lexort Exp $
# $NetBSD: Makefile,v 1.4 2010/06/10 14:45:05 lexort Exp $
VERSION= 0.1.${SVN_VERSION}
SVN_VERSION= 5285
@ -6,7 +6,7 @@ SVN_VERSION= 5285
DISTNAME= TracSensitiveTickets-${VERSION}
PKGNAME= trac-plugins-SensitiveTickets-${VERSION}
# Empty PKGREVISION because svn-package by default sets one.
PKGREVISION= 1
PKGREVISION= 2
EGG_NAME= ${DISTNAME}
CATEGORIES= www
MASTER_SITES= # not defined

View file

@ -0,0 +1,3 @@
$NetBSD: distinfo,v 1.1 2010/06/10 14:45:05 lexort Exp $
SHA1 (patch-aa) = 00c4e51bcfe70b07d0fbe9dcd5e43eb0fe0618ce

View file

@ -0,0 +1,24 @@
$NetBSD: patch-aa,v 1.1 2010/06/10 14:45:05 lexort Exp $
--- sensitivetickets/sensitivetickets.py.orig 2010-05-06 11:17:35.000000000 +0000
+++ sensitivetickets/sensitivetickets.py
@@ -10,6 +10,7 @@ from trac.core import *
from trac.perm import IPermissionPolicy, IPermissionRequestor
from trac.env import IEnvironmentSetupParticipant
from trac.ticket.model import Ticket
+from trac.resource import ResourceNotFound
class SensitiveTicketsPolicy(Component):
"""Prevent public access to security sensitive tickets.
@@ -45,7 +46,10 @@ class SensitiveTicketsPolicy(Component):
resource = resource.parent
if resource and resource.realm == 'ticket' and resource.id is not None:
- ticket = Ticket(self.env, int(resource.id))
+ try:
+ ticket = Ticket(self.env, int(resource.id))
+ except ResourceNotFound:
+ return
sensitive = ticket['sensitive']
if sensitive and int(sensitive):