+++ /dev/null
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package org.apache.catalina.ant;
-
-
-import org.apache.tools.ant.BuildException;
-
-
-/**
- * Ant task that implements the <code>/roles</code> command, supported by the
- * Tomcat manager application.
- *
- * @author Craig R. McClanahan
- * @version $Id$
- * @since 4.1
- */
-public class RolesTask extends AbstractCatalinaTask {
-
-
- // ------------------------------------------------------------- Properties
-
-
- // --------------------------------------------------------- Public Methods
-
-
- /**
- * Execute the requested operation.
- *
- * @exception BuildException if an error occurs
- */
- @Override
- public void execute() throws BuildException {
-
- super.execute();
- execute("/roles");
-
- }
-
-
-}
name="undeploy"
classname="org.apache.catalina.ant.UndeployTask" />
<typedef
- name="roles"
- classname="org.apache.catalina.ant.RolesTask" />
- <typedef
name="resources"
classname="org.apache.catalina.ant.ResourcesTask" />
<typedef
reload=org.apache.catalina.ant.ReloadTask
sessions=org.apache.catalina.ant.SessionsTask
resources=org.apache.catalina.ant.ResourcesTask
-roles=org.apache.catalina.ant.RolesTask
start=org.apache.catalina.ant.StartTask
stop=org.apache.catalina.ant.StopTask
undeploy=org.apache.catalina.ant.UndeployTask
managerServlet.reloaded=OK - Reloaded application at context path {0}
managerServlet.resourcesAll=OK - Listed global resources of all types
managerServlet.resourcesType=OK - Listed global resources of type {0}
-managerServlet.rolesList=OK - Listed security roles
managerServlet.saveFail=FAIL - Configuration save failed: {0}
managerServlet.saved=OK - Server configuration saved
managerServlet.savedContext=OK - Context {0} configuration saved
managerServlet.reloaded=OK - Anwendung mit Kontext Pfad {0} neu geladen
managerServlet.resourcesAll=OK - Auflistung globaler Ressourcen (alle Typen)
managerServlet.resourcesType=OK - Auflistung globaler Ressourcen von Typ {0}
-managerServlet.rolesList=OK - Auflistung der Sicherheits-Rollen
managerServlet.saveFail=FEHLER - Speichern der Konfiguration fehlgeschlagen: {0}
managerServlet.sessiondefaultmax=Voreingestellter Sitzungsablauf nach maximal {0} Minuten Inaktivit\u00e4t
#TODO: Please review the following three messages. These are displayed when "Expire sessions" button is pressed in the Manager webapp:
managerServlet.reloaded = OK - Recargada aplicaci\u00F3n en trayectoria de contexto {0}
managerServlet.resourcesAll = OK - Listados recursos globales de todos los tipos
managerServlet.resourcesType = OK - Listados recursos globales de tipo {0}
-managerServlet.rolesList = OK - Listados papeles de seguridad
managerServlet.saveFail = FAIL - Fallo al guardar la configuraci\u00F3n\: {0}
managerServlet.saved = OK - Configuraci\u00F3n de Servidor guardada
managerServlet.savedContext = OK - Configuraci\u00F3n de Contexto {0} guardada
managerServlet.reloaded=OK - L''application associ\u00e9e au chemin de contexte {0} a \u00e9t\u00e9 recharg\u00e9e
managerServlet.resourcesAll=OK - Liste des ressources globales de tout type
managerServlet.resourcesType=OK - Liste des ressources globales de type {0}
-managerServlet.rolesList=OK - Liste de r\u00f4les de securit\u00e9
managerServlet.saveFail=ECHEC - La sauvegarde de la configuration a \u00e9chou\u00e9: {0}
managerServlet.saved=OK - Configuration serveur sauvegard\u00e9e
managerServlet.savedContext=OK - Configuration du contexte {0} sauvegard\u00e9e
managerServlet.reloaded=OK - \u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u30d1\u30b9 {0} \u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u518d\u30ed\u30fc\u30c9\u3057\u307e\u3057\u305f
managerServlet.resourcesAll=OK - \u3059\u3079\u3066\u306e\u30bf\u30a4\u30d7\u306e\u30b0\u30ed\u30fc\u30d0\u30eb\u30ea\u30bd\u30fc\u30b9\u3092\u5217\u6319\u3057\u307e\u3057\u305f
managerServlet.resourcesType=OK - \u30bf\u30a4\u30d7 {0} \u306e\u30b0\u30ed\u30fc\u30d0\u30eb\u30ea\u30bd\u30fc\u30b9\u3092\u5217\u6319\u3057\u307e\u3057\u305f
-managerServlet.rolesList=OK - \u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30ed\u30fc\u30eb\u3092\u5217\u6319\u3057\u307e\u3057\u305f
managerServlet.saveFail=FAIL - \u8a2d\u5b9a\u306e\u4fdd\u5b58\u306b\u5931\u6557\u3057\u307e\u3057\u305f: {0}
managerServlet.saved=OK - \u30b5\u30fc\u30d0\u306e\u8a2d\u5b9a\u3092\u4fdd\u5b58\u3057\u307e\u3057\u305f
managerServlet.savedContext=OK - \u30b3\u30f3\u30c6\u30ad\u30b9\u30c8 {0} \u306e\u8a2d\u5b9a\u3092\u4fdd\u5b58\u3057\u307e\u3057\u305f
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Enumeration;
-import java.util.Iterator;
import java.util.Locale;
import javax.management.MBeanServer;
import javax.management.ObjectName;
import javax.naming.Binding;
-import javax.naming.InitialContext;
import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletInputStream;
import org.apache.catalina.Globals;
import org.apache.catalina.Host;
import org.apache.catalina.Manager;
-import org.apache.catalina.Role;
import org.apache.catalina.Server;
import org.apache.catalina.Session;
-import org.apache.catalina.UserDatabase;
import org.apache.catalina.Wrapper;
import org.apache.catalina.core.StandardHost;
import org.apache.catalina.core.StandardServer;
* <li><b>/resources?type=xxxx</b> - Enumerate the available global JNDI
* resources, optionally limited to those of the specified type
* (fully qualified Java class name), if available.</li>
- * <li><b>/roles</b> - Enumerate the available security role names and
- * descriptions from the user database connected to the <code>users</code>
- * resource reference.
* <li><b>/serverinfo</b> - Display system OS and JVM properties.
* <li><b>/sessions</b> - Deprecated. Use expire.
* <li><b>/expire?path=/xxx</b> - List session idle timeinformation about the
reload(writer, cn, smClient);
} else if (command.equals("/resources")) {
resources(writer, type, smClient);
- } else if (command.equals("/roles")) {
- roles(writer, smClient);
} else if (command.equals("/save")) {
save(writer, path, smClient);
} else if (command.equals("/serverinfo")) {
/**
- * Render a list of security role names (and corresponding descriptions)
- * from the <code>org.apache.catalina.UserDatabase</code> resource that is
- * connected to the <code>users</code> resource reference. Typically, this
- * will be the global user database, but can be adjusted if you have
- * different user databases for different virtual hosts.
- *
- * @param writer Writer to render to
- */
- protected void roles(PrintWriter writer, StringManager smClient) {
-
- if (debug >= 1) {
- log("roles: List security roles from user database");
- }
-
- // Look up the UserDatabase instance we should use
- UserDatabase database = null;
- try {
- InitialContext ic = new InitialContext();
- database = (UserDatabase) ic.lookup("java:comp/env/users");
- } catch (NamingException e) {
- writer.println(smClient.getString(
- "managerServlet.userDatabaseError"));
- log("java:comp/env/users", e);
- return;
- }
- if (database == null) {
- writer.println(smClient.getString(
- "managerServlet.userDatabaseMissing"));
- return;
- }
-
- // Enumerate the available roles
- writer.println(smClient.getString("managerServlet.rolesList"));
- Iterator<Role> roles = database.getRoles();
- if (roles != null) {
- while (roles.hasNext()) {
- Role role = roles.next();
- writer.print(role.getRolename());
- writer.print(':');
- if (role.getDescription() != null) {
- writer.print(role.getDescription());
- }
- writer.println();
- }
- }
-
-
- }
-
-
- /**
* Writes System OS and JVM properties.
* @param writer Writer to render to
*/
</fix>
</changelog>
</subsection>
+ <subsection name="Wep applications">
+ <changelog>
+ <fix>
+ <bug>50713</bug>: Remove roles command from the Manager application.
+ (markt)
+ </fix>
+ </changelog>
+ </subsection>
<subsection name="Tribes">
<changelog>
<fix>
- <rev>1068549</rev> <bug>50667</bug>: Allow RPC callers to get confirmation when sending a reply.
+ <rev>1068549</rev> <bug>50667</bug>: Allow RPC callers to get
+ confirmation when sending a reply. (fhanik)
</fix>
</changelog>
</subsection>
example for Tomcat running on Windows:</p>
<source>
<Context path="/foobar" docBase="C:\path\to\application\foobar">
-
- <!-- Link to the user database we will get roles from -->
- <ResourceLink name="users" global="UserDatabase"
- type="org.apache.catalina.UserDatabase"/>
-
</Context>
</source>
<li>List the available global JNDI resources, for use in deployment
tools that are preparing <code><ResourceLink></code> elements
nested in a <code><Context></code> deployment description.</li>
-<li>List the available security roles defined in the user database.</li>
<li>Start a stopped application (thus making it available again).</li>
<li>Stop an existing application (so that it becomes unavailable), but
do not undeploy it.</li>
example:</p>
<source>
<Context path="/foobar" docBase="/path/to/application/foobar">
-
- <!-- Link to the user database we will get roles from -->
- <ResourceLink name="users" global="UserDatabase"
- type="org.apache.catalina.UserDatabase"/>
-
</Context>
</source>
</subsection>
-
-<subsection name="List Available Security Roles">
-
-<source>
-http://localhost:8080/manager/text/roles
-</source>
-
-<p>List the security role names (and corresponding descriptions) that are
-available in the <code>org.apache.catalina.UserDatabase</code> resource that
-is linked to the <code>users</code> resource reference in the web.xml file
-for the Manager web application. This would typically be used, for example,
-by a deployment tool that wanted to create
-<code><security-role-ref></code> elements to map security role names
-used in a web application to the role names actually defined within the
-container.</p>
-
-<p>By default, the <code>users</code> resource reference is pointed at the
-global <code>UserDatabase</code> resource. If you choose to utilize a
-different user database per virtual host, you should modify the
-<code><ResourceLink></code> element in the default
-<code>manager.xml</code> context configuration file to point at the global
-user database resource for this virtual host.</p>
-
-<p>When this command is executed, the first line of the response will be:</p>
-<pre>
- OK - Listed security roles
-</pre>
-<p>followed by one line for each security role. Each line is composed of
-fields delimited by colon characters (":") as follows:</p>
-<ul>
-<li><em>Security Role Name</em> - A security role name that is known to Tomcat
- in the user database.</li>
-<li><em>Description</em> - Description of this security role (useful in
- creating user interfaces for selecting roles.</li>
-</ul>
-
-<p>If an error occurs, the response will start with <code>FAIL</code> and
-include an error message. Possible causes for problems include:</p>
-<ul>
-<li><em>Cannot resolve user database reference</em> - A JNDI error prevented
- the successful lookup of the <code>org.apache.catalina.UserDatabase</code>
- resource. Check the Tomcat log files for a stack trace associated with
- this error.</li>
-<li><em>No user database is available</em> - You have not configured a resource
- reference for the <code>users</code> resource that points at an
- appropriate user database instance. Check your <code>manager.xml</code>
- file and ensure that you have created an appropriate
- <code><ResourceLink></code> or
- <code><ResourceParams></code> element for this resource.</li>
-</ul>
-
-</subsection>
-
-
<subsection name="Session Statistics">
<source>
<taskdef name="list" classname="org.apache.catalina.ant.ListTask"/>
<taskdef name="reload" classname="org.apache.catalina.ant.ReloadTask"/>
<taskdef name="resources" classname="org.apache.catalina.ant.ResourcesTask"/>
- <taskdef name="roles" classname="org.apache.catalina.ant.RolesTask"/>
<taskdef name="start" classname="org.apache.catalina.ant.StartTask"/>
<taskdef name="stop" classname="org.apache.catalina.ant.StopTask"/>
<taskdef name="undeploy" classname="org.apache.catalina.ant.UndeployTask"/>
<servlet-name>jsp</servlet-name>
</filter-mapping>
- <!-- Define reference to the user database for looking up roles -->
- <resource-env-ref>
- <description>
- Link to the UserDatabase instance from which we request lists of
- defined role names. Typically, this will be connected to the global
- user database with a ResourceLink element in server.xml or the context
- configuration file for the Manager web application.
- </description>
- <resource-env-ref-name>users</resource-env-ref-name>
- <resource-env-ref-type>
- org.apache.catalina.UserDatabase
- </resource-env-ref-type>
- </resource-env-ref>
-
<!-- Define a Security Constraint on this Application -->
<!-- NOTE: None of these roles are present in the default users file -->
<security-constraint>