~ubuntu-branches/ubuntu/lucid/tomcat6/lucid

« back to all changes in this revision

Viewing changes to java/org/apache/catalina/realm/RealmBase.java

  • Committer: Bazaar Package Importer
  • Author(s): Mathias Gug, Iulian Udrea
  • Date: 2009-06-09 12:35:19 UTC
  • mfrom: (1.2.1 upstream) (2.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20090609123519-7owjbso5ttnka6ur
Tags: 6.0.20-1ubuntu1
[ Iulian Udrea ]
* Merge from debian unstable (LP: #385262), remaining changes:
  - debian/control, debian/rules: Use default-jdk to build
  - debian/control: Run using default-jre-headless by default

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
 * location) are identical to those currently supported by Tomcat 3.X.
63
63
 *
64
64
 * @author Craig R. McClanahan
65
 
 * @version $Revision: 645149 $ $Date: 2008-04-05 19:57:08 +0200 (Sat, 05 Apr 2008) $
 
65
 * @version $Revision: 707757 $ $Date: 2008-10-24 23:54:48 +0200 (Fri, 24 Oct 2008) $
66
66
 */
67
67
 
68
68
public abstract class RealmBase
787
787
                    log.debug("  No user authenticated, cannot grant access");
788
788
            } else {
789
789
                for (int j = 0; j < roles.length; j++) {
790
 
                    if (hasRole(principal, roles[j]))
 
790
                    if (hasRole(principal, roles[j])) {
791
791
                        status = true;
792
 
                    if( log.isDebugEnabled() )
 
792
                        if( log.isDebugEnabled() )
 
793
                            log.debug( "Role found:  " + roles[j]);
 
794
                    }
 
795
                    else if( log.isDebugEnabled() )
793
796
                        log.debug( "No role found:  " + roles[j]);
794
797
                }
795
798
            }
1214
1217
 
1215
1218
 
1216
1219
    /**
1217
 
     * Digest password using the algorithm especificied and
 
1220
     * Digest password using the algorithm specified and
1218
1221
     * convert the result to a corresponding hex string.
1219
1222
     * If exception, the plain credentials string is returned
1220
1223
     *
1250
1253
 
1251
1254
 
1252
1255
    /**
1253
 
     * Digest password using the algorithm especificied and
 
1256
     * Digest password using the algorithm specified and
1254
1257
     * convert the result to a corresponding hex string.
1255
1258
     * If exception, the plain credentials string is returned
1256
1259
     */
1282
1285
    protected String domain;
1283
1286
    protected String host;
1284
1287
    protected String path;
 
1288
    protected String realmPath = "/realm0";
1285
1289
    protected ObjectName oname;
1286
1290
    protected ObjectName controller;
1287
1291
    protected MBeanServer mserver;
1306
1310
        return type;
1307
1311
    }
1308
1312
 
 
1313
    public String getRealmPath() {
 
1314
        return realmPath;
 
1315
    }
 
1316
    
 
1317
    public void setRealmPath(String theRealmPath) {
 
1318
        realmPath = theRealmPath;
 
1319
    }
 
1320
 
1309
1321
    public ObjectName preRegister(MBeanServer server,
1310
1322
                                  ObjectName name) throws Exception {
1311
1323
        oname=name;
1367
1379
            // register
1368
1380
            try {
1369
1381
                ContainerBase cb=(ContainerBase)container;
1370
 
                oname=new ObjectName(cb.getDomain()+":type=Realm" + cb.getContainerSuffix());
 
1382
                oname=new ObjectName(cb.getDomain()+":type=Realm" +
 
1383
                        getRealmSuffix() + cb.getContainerSuffix());
1371
1384
                Registry.getRegistry(null, null).registerComponent(this, oname, null );
1372
1385
                if(log.isDebugEnabled())
1373
1386
                    log.debug("Register Realm "+oname);
1379
1392
    }
1380
1393
 
1381
1394
 
 
1395
    protected String getRealmSuffix() {
 
1396
        return ",realmPath=" + getRealmPath();
 
1397
    }
 
1398
 
 
1399
 
1382
1400
    protected static class AllRolesMode {
1383
1401
        
1384
1402
        private String name;