VirtualBox

Changes between Version 72 and Version 73 of Mac OS X build instructions


Ignore:
Timestamp:
Sep 8, 2011 12:38:59 PM (13 years ago)
Author:
Christian Pötzsch
Comment:

rpath

Legend:

Unmodified
Added
Removed
Modified
  • Mac OS X build instructions

    v72 v73  
    113113}}}
    114114Another requirement of hardening is that every path component of the parent directory of `VirtualBox.app/` is owned by `root` and not `world` writable. Make sure this is the case.
     115=== Relative vs. absolute paths in the used libraries ===
     116If you see something like the following error when starting !VirtualBox you need to change the used libraries to use absolute paths.
     117{{{
     118VirtualBox: supR3HardenedMainGetTrustedMain: dlopen("/Applications/VirtualBox.app/Contents/MacOS/VirtualBox.dylib",) failed: \
     119 dlopen(/Applications/VirtualBox.app/Contents/MacOS/VirtualBox.dylib, 10): Library not loaded: QtCore.framework/Versions/4/QtCore
     120  Referenced from: /Applications/VirtualBox.app/Contents/MacOS/VirtualBox.dylib
     121  Reason: unsafe use of relative rpath QtCore.framework/Versions/4/QtCore in /Applications/VirtualBox.app/Contents/MacOS/VirtualBox.dylib with restricted binary
     122}}}
     123On Mac OS X it isn't allowed to use libraries with relative paths for referencing to other libraries when the executable is setuid. You can display all linked libraries by the following command:
     124{{{
     125otool -L /Applications/VirtualBox.app/Contents/MacOS/VirtualBox.dylib
     126}}}
     127Next, assuming Qt is installed in /Applications/VirtualBox.app/Contents/Frameworks/, you can change the path by using this:
     128{{{
     129install_name_tool -id /Applications/VirtualBox.app/Contents/Frameworks/QtGui.framework/Versions/4/QtGui /Applications/VirtualBox.app/Contents/Frameworks/QtGui.framework/Versions/4/QtGui
     130install_name_tool -change @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore /Applications/VirtualBox.app/Contents/Frameworks/QtCore.framework/Versions/4/QtCore /Applications/VirtualBox.app/Contents/Frameworks/QtGui.framework/Versions/4/QtGui
     131}}}
     132The first command changes the identifier of the library itself. The second changes references to other libraries. There, the first path is the old referenced path, the second one is the new path and the last path is the file to change (see man install_name_tool). Note, you need to repeat this with every library involved.

© 2023 Oracle
ContactPrivacy policyTerms of Use