VirtualBox

Changeset 30312 in vbox for trunk


Ignore:
Timestamp:
Jun 18, 2010 1:13:13 PM (14 years ago)
Author:
vboxsync
Message:

Runtime/process-posix: Better error message if the binaries format is invalid. Can happen if the user tries to execute guest shell scripts with the missing magic '#!/bin/sh'.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/posix/process-posix.cpp

    r29636 r30312  
    394394             */
    395395            rc = execve(pszExec, (char * const *)papszArgs, (char * const *)papszEnv);
    396             AssertReleaseMsgFailed(("execve returns %d errno=%d\n", rc, errno));
     396            if (errno == ENOEXEC)
     397            {
     398                /* This can happen when trying to start a shell script without the magic #!/bin/sh */
     399                RTAssertMsg2Weak("Cannot execute this binary format!\n");
     400            }
     401            else
     402                RTAssertMsg2Weak("execve returns %d errno=%d\n", rc, errno);
     403            RTAssertReleasePanic();
    397404            exit(127);
    398405        }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette