Bug 31132

Summary: missing
Product: Tomcat 5 Reporter: Stephen More <smore>
Component: CatalinaAssignee: Tomcat Developers Mailing List <dev>
Severity: normal    
Priority: P5    
Version: 5.0.28   
Target Milestone: ---   
Hardware: Other   
OS: All   
Attachments: Patch for startup.sh
Patch for catalina.sh
Patch for setclasspath.sh

Description Stephen More 2004-09-08 21:08:27 UTC
There are certain shell tests that do not work properly on the 400's qshell. 
Like -x and -r.

These will only work if:
   1. The user is the owner of the file
or 2. The file's group ownership is by the user's PRIMARY group.

If the file's group ownership is in the user's secondary groups, the qshell 
tests will fail, even though it has authority to run/read it.

I have been making changes like this:

# -----------------------------------------------------------------------------
# Start Script for the CATALINA Server
# $Id: startup.sh,v 1.3 2002/08/04 18:19:43 patrickl Exp $
# -----------------------------------------------------------------------------

case "`uname`" in
OS400*) os400=true;;

# resolve links - $0 may be a softlink

while [ -h "$PRG" ] ; do
  ls=`ls -ld "$PRG"`
  link=`expr "$ls" : '.*-> \(.*\)$'`
  if expr "$link" : '.*/.*' > /dev/null; then
    PRG=`dirname "$PRG"`/"$link"
PRGDIR=`dirname "$PRG"`

# Check that target executable exists
if $os400; then
  # -x will Only work on the os400 if the files are: 
  # 1. owned by the user
  # 2. owned by the PRIMARY group of the user
  # this will not work if the user belongs in secondary groups
  if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
    echo "Cannot find $PRGDIR/$EXECUTABLE"
    echo "This file is needed to run this program"
    exit 1

exec "$PRGDIR"/"$EXECUTABLE" start "$@"
Comment 1 Yoav Shapira 2004-10-29 18:29:13 UTC
Please attach your proposed changes in diff -u format, instead of the whole 
file.  When you do that I'll be glad to look at them and commit them.  Thanks.
Comment 2 Stephen More 2004-11-01 13:58:15 UTC
Created attachment 13289 [details]
Patch for startup.sh
Comment 3 Stephen More 2004-11-01 13:58:37 UTC
Created attachment 13290 [details]
Patch for catalina.sh
Comment 4 Stephen More 2004-11-01 13:58:56 UTC
Created attachment 13291 [details]
Patch for setclasspath.sh
Comment 5 Yoav Shapira 2004-11-17 21:18:14 UTC
OK, done for Tomcat 5.0.30 and 5.5.5.  Thanks for submitting this patch.