Menu

#311 script failed to run on a MacOSX folder with double spaces

v3.5.41
closed-fixed
5
2021-01-05
2020-01-24
Wendy Wang
No

When exectuing sh.script.in on a MacOSX folder which having double spaces e.g. "/Applications/123/test test" folder, it throws 'Failed to access the script using an absolute path. Insufficient permissions may prevent the user xxx from traversing one of the folders. Please check the following permissions",
However the same script is exectuted succesfully on a folder which having a single space e.g. "/Applications/123/test test".

Discussion

  • Leif Mortenson

    Leif Mortenson - 2020-11-26

    Wendy
    Sorry for the delay. This has been fixed for the next release.
    If you need it sooner, please make the following changes to the script.

    --- community/src/bin/App.sh.in (revision 2044)
    +++ community/src/bin/App.sh.in (working copy)
    @@ -333,7 +333,7 @@
     while [ "X$CHANGED" != "X" ]
     do
         # Change spaces to ":" so the tokens can be parsed.
    -    SAFESCRIPT=`echo $SCRIPT | sed -e 's; ;:;g'`
    +    SAFESCRIPT=`echo "$SCRIPT" | sed -e 's; ;:;g'`
         # Get the real path to this script, resolving any symbolic links
         TOKENS=`echo $SAFESCRIPT | sed -e 's;/; ;g'`
         REALPATH=
    @@ -1323,7 +1323,7 @@
         then 
             # The string passed to eval must handles spaces in paths correctly.
             COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.daemonize=TRUE $APPNAMEPROP $ANCHORPROP $IGNOREPROP $STATUSPROP $COMMANDPROP $LOCKPROP wrapper.script.version=3.5.45-a $ADDITIONAL_PARA"
    -        eval $COMMAND_LINE
    +        eval "$COMMAND_LINE"
         else
             eval echo `gettext '$APP_LONG_NAME is already running.'`
             exit 1
    @@ -1346,7 +1346,7 @@
    
             # The string passed to eval must handles spaces in paths correctly.
             COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" $APPNAMEPROP $ANCHORPROP $STATUSPROP $COMMANDPROP $LOCKPROP wrapper.script.version=3.5.45-a $ADDITIONAL_PARA"
    -        eval $COMMAND_LINE
    +        eval "$COMMAND_LINE"
             COMMAND_EXIT_CODE=$?
             if [ $COMMAND_EXIT_CODE -ne 0 ] ; then
                 exit $COMMAND_EXIT_CODE
    @@ -1810,7 +1810,7 @@
    
         # The string passed to eval must handles spaces in paths correctly.
         COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.daemonize=TRUE $APPNAMEPROP $ANCHORPROP $IGNOREPROP $STATUSPROP $COMMANDPROP $LOCKPROP wrapper.script.version=3.5.45-a $ADDITIONAL_PARA"
    -    eval $COMMAND_LINE
    +    eval "$COMMAND_LINE"
    
         startwait
     }
    
     
  • Leif Mortenson

    Leif Mortenson - 2020-11-26
    • status: open --> open-fixed
    • assigned_to: Leif Mortenson
     
  • Maxime Andrighetto

    Version 3.5.45 is now released with this issue fixed.

     
  • Maxime Andrighetto

    • status: open-fixed --> closed-fixed
     

Log in to post a comment.