~ubuntu-branches/ubuntu/vivid/tomcat6/vivid-proposed

« back to all changes in this revision

Viewing changes to java/org/apache/catalina/core/StandardWrapper.java

  • Committer: Package Import Robot
  • Author(s): tony mancill
  • Date: 2013-08-03 21:50:20 UTC
  • mfrom: (1.2.9)
  • Revision ID: package-import@ubuntu.com-20130803215020-glb1brkoau0zxr5x
Tags: 6.0.37-1
* New upstream release.
  - Drop patches for CVE-2012-4534, CVE-2012-4431, CVE-2012-3546,
    CVE-2012-2733, CVE-2012-3439
  - Drop 0011-CVE-02012-0022-regression-fix.patch
  - Drop 0017-eclipse-compiler-update.patch
* Freshened remaining patches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
 *
74
74
 * @author Craig R. McClanahan
75
75
 * @author Remy Maucherat
76
 
 * @version $Id: StandardWrapper.java 1200269 2011-11-10 11:16:01Z kkolinko $
 
76
 * @version $Id: StandardWrapper.java 1431946 2013-01-11 09:23:06Z kkolinko $
77
77
 */
78
78
public class StandardWrapper
79
79
    extends ContainerBase
1195
1195
                                                  servlet);
1196
1196
 
1197
1197
                if( Globals.IS_SECURITY_ENABLED) {
1198
 
 
1199
 
                    Object[] args = new Object[]{((ServletConfig)facade)};
1200
 
                    SecurityUtil.doAsPrivilege("init",
1201
 
                                               servlet,
1202
 
                                               classType,
1203
 
                                               args);
1204
 
                    args = null;
 
1198
                    boolean success = false;
 
1199
                    try {
 
1200
                        Object[] args = new Object[]{ facade };
 
1201
                        SecurityUtil.doAsPrivilege("init",
 
1202
                                                   servlet,
 
1203
                                                   classType,
 
1204
                                                   args);
 
1205
                        success = true;
 
1206
                    } finally {
 
1207
                        if (!success) {
 
1208
                            // destroy() will not be called, thus clear the reference now
 
1209
                            SecurityUtil.remove(servlet);
 
1210
                        }
 
1211
                    }
1205
1212
                } else {
1206
1213
                    servlet.init(facade);
1207
1214
                }
1429
1436
              (InstanceEvent.BEFORE_DESTROY_EVENT, instance);
1430
1437
 
1431
1438
            if( Globals.IS_SECURITY_ENABLED) {
1432
 
                SecurityUtil.doAsPrivilege("destroy",
1433
 
                                           instance);
1434
 
                SecurityUtil.remove(instance);                           
 
1439
                try {
 
1440
                    SecurityUtil.doAsPrivilege("destroy",
 
1441
                                               instance);
 
1442
                } finally {
 
1443
                    SecurityUtil.remove(instance);
 
1444
                }
1435
1445
            } else {
1436
1446
                instance.destroy();
1437
1447
            }
1477
1487
                while (!instancePool.isEmpty()) {
1478
1488
                    Servlet s = (Servlet) instancePool.pop();
1479
1489
                    if (Globals.IS_SECURITY_ENABLED) {
1480
 
                        SecurityUtil.doAsPrivilege("destroy", s);
1481
 
                        SecurityUtil.remove(instance);                           
 
1490
                        try {
 
1491
                            SecurityUtil.doAsPrivilege("destroy", s);
 
1492
                        } finally {
 
1493
                            SecurityUtil.remove(s);
 
1494
                        }
1482
1495
                    } else {
1483
1496
                        s.destroy();
1484
1497
                    }