You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jspwiki.apache.org by ju...@apache.org on 2018/03/29 17:45:19 UTC

[jspwiki] branch master updated (5e8402c -> e4c6aaf)

This is an automated email from the ASF dual-hosted git repository.

juanpablo pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git.


    from 5e8402c  oops fix typo
     new 5078215  always stash the wikiContext, it is also needed on places without authorization, for example at wiki:message tag (specifically when on WikiTagBase:81-84) on Error.jsp
     new 4b21a46  remove dead code, replace deprecated .getRootCause() with .getCause()
     new a25a291  tiny code format
     new 7fc592e  Main page can be revealed when invoking some JSPs without parameters (reported by Motohiko Matsuda, thanks\!)
     new e4c6aaf  2.10.4-git-03

The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 ChangeLog                                          |  7 +++
 .../src/main/java/org/apache/wiki/Release.java     |  2 +-
 .../org/apache/wiki/auth/AuthorizationManager.java | 31 ++++++-------
 jspwiki-war/src/main/webapp/Comment.jsp            |  4 ++
 jspwiki-war/src/main/webapp/Delete.jsp             |  6 ++-
 jspwiki-war/src/main/webapp/Diff.jsp               | 16 ++++---
 jspwiki-war/src/main/webapp/Edit.jsp               |  6 ++-
 jspwiki-war/src/main/webapp/Error.jsp              | 53 ++++++++++------------
 jspwiki-war/src/main/webapp/PageInfo.jsp           | 18 +++++---
 jspwiki-war/src/main/webapp/PageModified.jsp       |  6 ++-
 jspwiki-war/src/main/webapp/Preview.jsp            | 14 ++++--
 jspwiki-war/src/main/webapp/Rename.jsp             | 10 ++--
 jspwiki-war/src/main/webapp/Wiki.jsp               | 10 ++--
 13 files changed, 106 insertions(+), 77 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
juanpablo@apache.org.

[jspwiki] 01/05: always stash the wikiContext, it is also needed on places without authorization, for example at wiki:message tag (specifically when on WikiTagBase:81-84) on Error.jsp

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juanpablo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git

commit 50782156e93a47a79dbc5414c1b2883a0b376df2
Author: juanpablo <ju...@apache.org>
AuthorDate: Thu Mar 29 19:19:49 2018 +0200

    always stash the wikiContext, it is also needed on places without authorization, for example at wiki:message tag (specifically when on WikiTagBase:81-84) on Error.jsp
---
 .../org/apache/wiki/auth/AuthorizationManager.java | 31 ++++++++++------------
 1 file changed, 14 insertions(+), 17 deletions(-)

diff --git a/jspwiki-war/src/main/java/org/apache/wiki/auth/AuthorizationManager.java b/jspwiki-war/src/main/java/org/apache/wiki/auth/AuthorizationManager.java
index 02089c7..99b2104 100644
--- a/jspwiki-war/src/main/java/org/apache/wiki/auth/AuthorizationManager.java
+++ b/jspwiki-war/src/main/java/org/apache/wiki/auth/AuthorizationManager.java
@@ -1,4 +1,4 @@
-/* 
+/*
     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
@@ -14,7 +14,7 @@
     "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.  
+    under the License.
  */
 package org.apache.wiki.auth;
 
@@ -105,7 +105,7 @@ public class AuthorizationManager {
 
     /** Property that supplies the security policy file name, in WEB-INF. */
     protected static final String             POLICY      = "jspwiki.policy.file";
-    
+
     /** Name of the default security policy file, in WEB-INF. */
     protected static final String             DEFAULT_POLICY      = "jspwiki.policy";
 
@@ -376,7 +376,7 @@ public class AuthorizationManager {
         }
         return false;
     }
-    
+
     /**
      * Checks whether the current user has access to the wiki context,
      * by obtaining the required Permission ({@link WikiContext#requiredPermission()})
@@ -388,7 +388,7 @@ public class AuthorizationManager {
      * Note that this method will automatically redirect the user to
      * a login or error page, as appropriate, if access fails. This is
      * NOT guaranteed to be default behavior in the future.
-     * 
+     *
      * @param context wiki context to check if it is accesible
      * @param response the http response
      * @return the result of the access check
@@ -407,7 +407,7 @@ public class AuthorizationManager {
      * <code>false</code> otherwise. If access is allowed,
      * the wiki context will be added to the request as attribute
      * with the key name {@link org.apache.wiki.tags.WikiTagBase#ATTR_CONTEXT}.
-     * 
+     *
      * @param context wiki context to check if it is accesible
      * @param response The servlet response object
      * @param redirect If true, makes an automatic redirect to the response
@@ -420,12 +420,9 @@ public class AuthorizationManager {
         ResourceBundle rb = Preferences.getBundle( context, InternationalizationManager.CORE_BUNDLE );
 
         // Stash the wiki context
-        if( allowed )
+        if ( context.getHttpRequest() != null && context.getHttpRequest().getAttribute( WikiTagBase.ATTR_CONTEXT ) == null )
         {
-            if ( context.getHttpRequest() != null && context.getHttpRequest().getAttribute( WikiTagBase.ATTR_CONTEXT ) == null )
-            {
-                context.getHttpRequest().setAttribute( WikiTagBase.ATTR_CONTEXT, context );
-            }
+            context.getHttpRequest().setAttribute( WikiTagBase.ATTR_CONTEXT, context );
         }
 
         // If access not allowed, redirect
@@ -436,13 +433,13 @@ public class AuthorizationManager {
             if( context.getWikiSession().isAuthenticated() )
             {
                 log.info("User "+currentUser.getName()+" has no access - forbidden (permission=" + context.requiredPermission() + ")" );
-                context.getWikiSession().addMessage( 
+                context.getWikiSession().addMessage(
                                MessageFormat.format( rb.getString("security.error.noaccess.logged"), context.getName()) );
             }
             else
             {
                 log.info("User "+currentUser.getName()+" has no access - redirecting (permission=" + context.requiredPermission() + ")");
-                context.getWikiSession().addMessage( 
+                context.getWikiSession().addMessage(
                                MessageFormat.format( rb.getString("security.error.noaccess"), context.getName()) );
             }
             response.sendRedirect( m_engine.getURL(WikiContext.LOGIN, pageurl, null, false ) );
@@ -473,8 +470,8 @@ public class AuthorizationManager {
         {
             String policyFileName = properties.getProperty( POLICY, DEFAULT_POLICY );
             URL policyURL = AuthenticationManager.findConfigFile( engine, policyFileName );
-            
-            if (policyURL != null) 
+
+            if (policyURL != null)
             {
                 File policyFile = new File( policyURL.toURI().getPath() );
                 log.info("We found security policy URL: " + policyURL + " and transformed it to file " + policyFile.getAbsolutePath());
@@ -484,8 +481,8 @@ public class AuthorizationManager {
             }
             else
             {
-                String sb = "JSPWiki was unable to initialize the default security policy (WEB-INF/jspwiki.policy) file. " + 
-                            "Please ensure that the jspwiki.policy file exists in the default location. " + 
+                String sb = "JSPWiki was unable to initialize the default security policy (WEB-INF/jspwiki.policy) file. " +
+                            "Please ensure that the jspwiki.policy file exists in the default location. " +
                 		    "This file should exist regardless of the existance of a global policy file. " +
                             "The global policy file is identified by the java.security.policy variable. ";
                 WikiSecurityException wse = new WikiSecurityException( sb );

-- 
To stop receiving notification emails like this one, please contact
juanpablo@apache.org.

[jspwiki] 02/05: remove dead code, replace deprecated .getRootCause() with .getCause()

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juanpablo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git

commit 4b21a46ec90abad32e8604bb6837c9063f4109c2
Author: juanpablo <ju...@apache.org>
AuthorDate: Thu Mar 29 19:21:07 2018 +0200

    remove dead code, replace deprecated .getRootCause() with .getCause()
---
 jspwiki-war/src/main/webapp/Error.jsp | 53 +++++++++++++++--------------------
 1 file changed, 23 insertions(+), 30 deletions(-)

diff --git a/jspwiki-war/src/main/webapp/Error.jsp b/jspwiki-war/src/main/webapp/Error.jsp
index 68d49b6..b01f369 100644
--- a/jspwiki-war/src/main/webapp/Error.jsp
+++ b/jspwiki-war/src/main/webapp/Error.jsp
@@ -14,7 +14,7 @@
     "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.  
+    under the License.
 --%>
 
 <%@ page isErrorPage="true" %>
@@ -23,11 +23,11 @@
 <%@ page import="org.apache.wiki.util.FileUtil" %>
 <%@ taglib uri="http://jspwiki.apache.org/tags" prefix="wiki" %>
 <%!
-    Logger log = Logger.getLogger("JSPWiki"); 
+    Logger log = Logger.getLogger("JSPWiki");
 %>
 <%
     WikiEngine wiki = WikiEngine.getInstance( getServletConfig() );
-    WikiContext wikiContext = wiki.createContext( request, 
+    WikiContext wikiContext = wiki.createContext( request,
                                                   WikiContext.ERROR );
     String pagereq = wikiContext.getName();
 
@@ -37,35 +37,28 @@
 
     Throwable realcause = null;
 
-    if( exception != null )        
-    {   
-        msg = exception.getMessage();
-        if( msg == null || msg.length() == 0 )
-        {
-            msg = "An unknown exception "+exception.getClass().getName()+" was caught by Error.jsp.";
-        }
-
-        //
-        //  This allows us to get the actual cause of the exception.
-        //  Note the cast; at least Tomcat has two classes called "JspException"
-        //  imported in JSP pages.
-        //
-
-
-        if( exception instanceof javax.servlet.jsp.JspException )
-        {
-            log.debug("IS JSPEXCEPTION");
-            realcause = ((javax.servlet.jsp.JspException)exception).getRootCause();
-            log.debug("REALCAUSE="+realcause);
-        }
-
-        if( realcause == null ) realcause = exception;    
+    msg = exception.getMessage();
+    if( msg == null || msg.length() == 0 )
+    {
+        msg = "An unknown exception "+exception.getClass().getName()+" was caught by Error.jsp.";
     }
-    else
+
+    //
+    //  This allows us to get the actual cause of the exception.
+    //  Note the cast; at least Tomcat has two classes called "JspException"
+    //  imported in JSP pages.
+    //
+
+
+    if( exception instanceof javax.servlet.jsp.JspException )
     {
-        realcause = new Exception("Unknown general exception");
+        log.debug("IS JSPEXCEPTION");
+        realcause = ((javax.servlet.jsp.JspException)exception).getCause();
+        log.debug("REALCAUSE="+realcause);
     }
 
+    if( realcause == null ) realcause = exception;
+
     log.debug("Error.jsp exception is: ",exception);
 
 
@@ -78,7 +71,7 @@
       <dt><b>Error Message</b></dt>
       <dd>
          <wiki:Messages div="error" />
-      </dd>      
+      </dd>
       <dt><b>Exception</b></dt>
       <dd><%=realcause.getClass().getName()%></dd>
       <dt><b>Place where detected</b></dt>
@@ -91,7 +84,7 @@
    then you might want to check your configuration files.  If you are absolutely sure
    that JSPWiki was running quite okay or you can't figure out what is going
    on, then by all means, come over to <a href="http://jspwiki.apache.org/">jspwiki.apache.org</a>
-   and tell us.  There is more information in the log file (like the full stack trace, 
+   and tell us.  There is more information in the log file (like the full stack trace,
    which you should add to any error report).
    </p>
    <p>

-- 
To stop receiving notification emails like this one, please contact
juanpablo@apache.org.

[jspwiki] 04/05: Main page can be revealed when invoking some JSPs without parameters (reported by Motohiko Matsuda, thanks\!)

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juanpablo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git

commit 7fc592edd627d1df2c18f0f0f801a53af1da92c6
Author: juanpablo <ju...@apache.org>
AuthorDate: Thu Mar 29 19:43:42 2018 +0200

    Main page can be revealed when invoking some JSPs without parameters (reported by Motohiko Matsuda, thanks\!)
---
 jspwiki-war/src/main/webapp/Comment.jsp      |  4 ++++
 jspwiki-war/src/main/webapp/Delete.jsp       |  6 +++++-
 jspwiki-war/src/main/webapp/Diff.jsp         | 16 ++++++++++------
 jspwiki-war/src/main/webapp/Edit.jsp         |  6 +++++-
 jspwiki-war/src/main/webapp/PageInfo.jsp     | 18 +++++++++++-------
 jspwiki-war/src/main/webapp/PageModified.jsp |  6 +++++-
 jspwiki-war/src/main/webapp/Preview.jsp      | 14 +++++++++-----
 jspwiki-war/src/main/webapp/Rename.jsp       | 10 +++++++---
 8 files changed, 56 insertions(+), 24 deletions(-)

diff --git a/jspwiki-war/src/main/webapp/Comment.jsp b/jspwiki-war/src/main/webapp/Comment.jsp
index 641727c..eb30968 100644
--- a/jspwiki-war/src/main/webapp/Comment.jsp
+++ b/jspwiki-war/src/main/webapp/Comment.jsp
@@ -61,6 +61,10 @@
     // Create wiki context and check for authorization
     WikiContext wikiContext = wiki.createContext( request, WikiContext.COMMENT );
     if( !wiki.getAuthorizationManager().hasAccess( wikiContext, response ) ) return;
+    if( wikiContext.getCommand().getTarget() == null ) {
+        response.sendRedirect( wikiContext.getURL( wikiContext.getRequestContext(), wikiContext.getName() ) );
+        return;
+    }
     String pagereq = wikiContext.getName();
 
     ResourceBundle rb = Preferences.getBundle( wikiContext, "CoreResources" );
diff --git a/jspwiki-war/src/main/webapp/Delete.jsp b/jspwiki-war/src/main/webapp/Delete.jsp
index aba32e9..8e89d09 100644
--- a/jspwiki-war/src/main/webapp/Delete.jsp
+++ b/jspwiki-war/src/main/webapp/Delete.jsp
@@ -37,7 +37,11 @@
     WikiEngine wiki = WikiEngine.getInstance( getServletConfig() );
     // Create wiki context and check for authorization
     WikiContext wikiContext = wiki.createContext( request, WikiContext.DELETE );
-    if(!wiki.getAuthorizationManager().hasAccess( wikiContext, response )) return;
+    if( !wiki.getAuthorizationManager().hasAccess( wikiContext, response ) ) return;
+    if( wikiContext.getCommand().getTarget() == null ) {
+        response.sendRedirect( wikiContext.getURL( wikiContext.getRequestContext(), wikiContext.getName() ) );
+        return;
+    }
     String pagereq = wikiContext.getName();
 
     WikiPage wikipage      = wikiContext.getPage();
diff --git a/jspwiki-war/src/main/webapp/Diff.jsp b/jspwiki-war/src/main/webapp/Diff.jsp
index d8fae90..7dfaec2 100644
--- a/jspwiki-war/src/main/webapp/Diff.jsp
+++ b/jspwiki-war/src/main/webapp/Diff.jsp
@@ -14,7 +14,7 @@
     "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.  
+    under the License.
 --%>
 
 <%@ page import="org.apache.log4j.*" %>
@@ -26,23 +26,27 @@
 <%@ page errorPage="/Error.jsp" %>
 <%@ taglib uri="http://jspwiki.apache.org/tags" prefix="wiki" %>
 
-<%! 
-    Logger log = Logger.getLogger("JSPWiki"); 
+<%!
+    Logger log = Logger.getLogger("JSPWiki");
 %>
 
 <%
     WikiEngine wiki = WikiEngine.getInstance( getServletConfig() );
     // Create wiki context and check for authorization
     WikiContext wikiContext = wiki.createContext( request, WikiContext.DIFF );
-    if(!wiki.getAuthorizationManager().hasAccess( wikiContext, response )) return;
+    if( !wiki.getAuthorizationManager().hasAccess( wikiContext, response ) ) return;
+    if( wikiContext.getCommand().getTarget() == null ) {
+        response.sendRedirect( wikiContext.getURL( wikiContext.getRequestContext(), wikiContext.getName() ) );
+        return;
+    }
     String pagereq = wikiContext.getName();
 
     WatchDog w = wiki.getCurrentWatchDog();
     try
     {
     w.enterState("Generating INFO response",60);
-    
-    // Notused ? 
+
+    // Notused ?
     // String pageurl = wiki.encodeName( pagereq );
 
     // If "r1" is null, then assume current version (= -1)
diff --git a/jspwiki-war/src/main/webapp/Edit.jsp b/jspwiki-war/src/main/webapp/Edit.jsp
index c8efc65..3727204 100644
--- a/jspwiki-war/src/main/webapp/Edit.jsp
+++ b/jspwiki-war/src/main/webapp/Edit.jsp
@@ -53,7 +53,11 @@
     WikiEngine wiki = WikiEngine.getInstance( getServletConfig() );
     // Create wiki context and check for authorization
     WikiContext wikiContext = wiki.createContext( request, WikiContext.EDIT );
-    if(!wiki.getAuthorizationManager().hasAccess( wikiContext, response )) return;
+    if( !wiki.getAuthorizationManager().hasAccess( wikiContext, response ) ) return;
+    if( wikiContext.getCommand().getTarget() == null ) {
+        response.sendRedirect( wikiContext.getURL( wikiContext.getRequestContext(), wikiContext.getName() ) );
+        return;
+    }
     String pagereq = wikiContext.getName();
 
     WikiSession wikiSession = wikiContext.getWikiSession();
diff --git a/jspwiki-war/src/main/webapp/PageInfo.jsp b/jspwiki-war/src/main/webapp/PageInfo.jsp
index e6bd142..86885e4 100644
--- a/jspwiki-war/src/main/webapp/PageInfo.jsp
+++ b/jspwiki-war/src/main/webapp/PageInfo.jsp
@@ -14,7 +14,7 @@
     "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.  
+    under the License.
 --%>
 
 <%@ page import="org.apache.log4j.*" %>
@@ -24,21 +24,25 @@
 <%@ page errorPage="/Error.jsp" %>
 <%@ taglib uri="http://jspwiki.apache.org/tags" prefix="wiki" %>
 
-<%! 
-    Logger log = Logger.getLogger("JSPWiki"); 
+<%!
+    Logger log = Logger.getLogger("JSPWiki");
 %>
 
 <%
     WikiEngine wiki = WikiEngine.getInstance( getServletConfig() );
     // Create wiki context and check for authorization
     WikiContext wikiContext = wiki.createContext( request, WikiContext.INFO );
-    if(!wiki.getAuthorizationManager().hasAccess( wikiContext, response )) return;
+    if( !wiki.getAuthorizationManager().hasAccess( wikiContext, response ) ) return;
+    if( wikiContext.getCommand().getTarget() == null ) {
+        response.sendRedirect( wikiContext.getURL( wikiContext.getRequestContext(), wikiContext.getName() ) );
+        return;
+    }
     String pagereq = wikiContext.getName();
-    
+
     WatchDog w = wiki.getCurrentWatchDog();
-    try{
+    try {
     w.enterState("Generating INFO response",60);
-    
+
     // Set the content type and include the response content
     response.setContentType("text/html; charset="+wiki.getContentEncoding() );
     String contentPage = wiki.getTemplateManager().findJSP( pageContext,
diff --git a/jspwiki-war/src/main/webapp/PageModified.jsp b/jspwiki-war/src/main/webapp/PageModified.jsp
index 2437fab..99924cc 100644
--- a/jspwiki-war/src/main/webapp/PageModified.jsp
+++ b/jspwiki-war/src/main/webapp/PageModified.jsp
@@ -34,7 +34,11 @@
     WikiEngine wiki = WikiEngine.getInstance( getServletConfig() );
     // Create wiki context and check for authorization
     WikiContext wikiContext = wiki.createContext( request, WikiContext.CONFLICT );
-    if(!wiki.getAuthorizationManager().hasAccess( wikiContext, response )) return;
+    if( !wiki.getAuthorizationManager().hasAccess( wikiContext, response ) ) return;
+    if( wikiContext.getCommand().getTarget() == null ) {
+        response.sendRedirect( wikiContext.getURL( wikiContext.getRequestContext(), wikiContext.getName() ) );
+        return;
+    }
     String pagereq = wikiContext.getName();
 
     String usertext = (String)session.getAttribute( EditorManager.REQ_EDITEDTEXT );
diff --git a/jspwiki-war/src/main/webapp/Preview.jsp b/jspwiki-war/src/main/webapp/Preview.jsp
index 759a33f..1058fda 100644
--- a/jspwiki-war/src/main/webapp/Preview.jsp
+++ b/jspwiki-war/src/main/webapp/Preview.jsp
@@ -14,7 +14,7 @@
     "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.  
+    under the License.
 --%>
 
 <%@ page import="org.apache.log4j.*" %>
@@ -25,15 +25,19 @@
 <%@ page import="org.apache.wiki.ui.EditorManager" %>
 <%@ page errorPage="/Error.jsp" %>
 <%@ taglib uri="http://jspwiki.apache.org/tags" prefix="wiki" %>
-<%! 
-    Logger log = Logger.getLogger("JSPWiki"); 
+<%!
+    Logger log = Logger.getLogger("JSPWiki");
 %>
 
 <%
     WikiEngine wiki = WikiEngine.getInstance( getServletConfig() );
     // Create wiki context and check for authorization
     WikiContext wikiContext = wiki.createContext( request, WikiContext.PREVIEW );
-    if(!wiki.getAuthorizationManager().hasAccess( wikiContext, response )) return;
+    if( !wiki.getAuthorizationManager().hasAccess( wikiContext, response ) ) return;
+    if( wikiContext.getCommand().getTarget() == null ) {
+        response.sendRedirect( wikiContext.getURL( wikiContext.getRequestContext(), wikiContext.getName() ) );
+        return;
+    }
     String pagereq = wikiContext.getName();
 
     pageContext.setAttribute( EditorManager.ATTR_EDITEDTEXT,
@@ -45,7 +49,7 @@
     pageContext.setAttribute( "lastchange",
                               lastchange,
                               PageContext.REQUEST_SCOPE );
-   
+
     // Set the content type and include the response content
     response.setContentType("text/html; charset="+wiki.getContentEncoding() );
     String contentPage = wiki.getTemplateManager().findJSP( pageContext,
diff --git a/jspwiki-war/src/main/webapp/Rename.jsp b/jspwiki-war/src/main/webapp/Rename.jsp
index 1f4ba09..703787d 100644
--- a/jspwiki-war/src/main/webapp/Rename.jsp
+++ b/jspwiki-war/src/main/webapp/Rename.jsp
@@ -14,7 +14,7 @@
     "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.  
+    under the License.
 --%>
 
 <%@ page import="org.apache.log4j.*" %>
@@ -39,7 +39,11 @@
     WikiEngine wiki = WikiEngine.getInstance( getServletConfig() );
     // Create wiki context and check for authorization
 	WikiContext wikiContext = wiki.createContext( request, WikiContext.RENAME );
-    if(!wiki.getAuthorizationManager().hasAccess( wikiContext, response )) return;
+	if( !wiki.getAuthorizationManager().hasAccess( wikiContext, response ) ) return;
+    if( wikiContext.getCommand().getTarget() == null ) {
+        response.sendRedirect( wikiContext.getURL( wikiContext.getRequestContext(), wikiContext.getName() ) );
+        return;
+    }
 
     String renameFrom = wikiContext.getName();
     String renameTo = request.getParameter("renameto");
@@ -105,5 +109,5 @@
     String contentPage = wiki.getTemplateManager().findJSP( pageContext,
                                                             wikiContext.getTemplate(),
                                                             "ViewTemplate.jsp" );
-    
+
 %><wiki:Include page="<%=contentPage%>" />
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
juanpablo@apache.org.

[jspwiki] 05/05: 2.10.4-git-03

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juanpablo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git

commit e4c6aaf0101b9cc138611356fbf420623e5155a5
Author: juanpablo <ju...@apache.org>
AuthorDate: Thu Mar 29 19:44:53 2018 +0200

    2.10.4-git-03
---
 ChangeLog                                              | 7 +++++++
 jspwiki-war/src/main/java/org/apache/wiki/Release.java | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 923547f..1cfb7f7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2018-03-29  Juan Pablo Santos (juanpablo AT apache DOT org)
+
+       * 2.10.4-git-03
+
+       * Main page can be revealed when invoking some JSPs without parameters
+         (reported by Motohiko Matsuda, thanks!)
+
 2018-03-25  Juan Pablo Santos (juanpablo AT apache DOT org)
 
        * 2.10.4-git-02
diff --git a/jspwiki-war/src/main/java/org/apache/wiki/Release.java b/jspwiki-war/src/main/java/org/apache/wiki/Release.java
index 77b6865..487e9b1 100644
--- a/jspwiki-war/src/main/java/org/apache/wiki/Release.java
+++ b/jspwiki-war/src/main/java/org/apache/wiki/Release.java
@@ -72,7 +72,7 @@ public final class Release {
      *  <p>
      *  If the build identifier is empty, it is not added.
      */
-    public static final String     BUILD         = "2";
+    public static final String     BUILD         = "3";
 
     /**
      *  This is the generic version string you should use when printing out the version.  It is of

-- 
To stop receiving notification emails like this one, please contact
juanpablo@apache.org.

[jspwiki] 03/05: tiny code format

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juanpablo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git

commit a25a2913b263df84c0185b4f612fa3f213c29821
Author: juanpablo <ju...@apache.org>
AuthorDate: Thu Mar 29 19:41:57 2018 +0200

    tiny code format
---
 jspwiki-war/src/main/webapp/Wiki.jsp | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/jspwiki-war/src/main/webapp/Wiki.jsp b/jspwiki-war/src/main/webapp/Wiki.jsp
index 71cb38e..78201c1 100644
--- a/jspwiki-war/src/main/webapp/Wiki.jsp
+++ b/jspwiki-war/src/main/webapp/Wiki.jsp
@@ -14,7 +14,7 @@
     "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.  
+    under the License.
 --%>
 
 <%@ page import="org.apache.log4j.*" %>
@@ -25,14 +25,14 @@
 <%@ page errorPage="/Error.jsp" %>
 <%@ taglib uri="http://jspwiki.apache.org/tags" prefix="wiki" %>
 <%!
-    Logger log = Logger.getLogger("JSPWiki"); 
+    Logger log = Logger.getLogger("JSPWiki");
 %>
 
 <%
     WikiEngine wiki = WikiEngine.getInstance( getServletConfig() );
     // Create wiki context and check for authorization
     WikiContext wikiContext = wiki.createContext( request, WikiContext.VIEW );
-    if(!wiki.getAuthorizationManager().hasAccess( wikiContext, response )) return;
+    if( !wiki.getAuthorizationManager().hasAccess( wikiContext, response ) ) return;
     String pagereq = wikiContext.getName();
 
     // Redirect if request was for a special page
@@ -42,13 +42,13 @@
         response.sendRedirect( redirect );
         return;
     }
-    
+
     StopWatch sw = new StopWatch();
     sw.start();
     WatchDog w = wiki.getCurrentWatchDog();
     try {
         w.enterState("Generating VIEW response for "+wikiContext.getPage(),60);
-    
+
         // Set the content type and include the response content
         response.setContentType("text/html; charset="+wiki.getContentEncoding() );
         String contentPage = wiki.getTemplateManager().findJSP( pageContext,

-- 
To stop receiving notification emails like this one, please contact
juanpablo@apache.org.