VirtualBox

Changeset 21090 in vbox for trunk


Ignore:
Timestamp:
Jun 30, 2009 5:49:55 PM (16 years ago)
Author:
vboxsync
Message:

Main/xpcom/server: Launch only kernel arch matching VBoxSVC for Solaris hardened builds.

Location:
trunk/src/VBox/Main
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/Makefile.kmk

    r21079 r21090  
    486486VBoxSVCM_TEMPLATE       = VBOXMAINCOMP
    487487VBoxSVCM_DEFS           = IN_RING3 $(VBOX_MAIN_DEFS)
     488ifdef VBOX_WITH_HARDENING
     489 VBoxSVCM_DEFS         += VBOX_WITH_HARDENING
     490endif
    488491VBoxSVCM_INCS           = \
    489492        include \
  • trunk/src/VBox/Main/xpcom/server_module.cpp

    r15604 r21090  
    5858#include <string.h>
    5959
     60#if defined(RT_OS_SOLARIS)
     61# include <sys/systeminfo.h>
     62#endif
    6063
    6164/// @todo move this to RT headers (and use them in MachineImpl.cpp as well)
     
    138141                                     rc = NS_ERROR_FAILURE);
    139142
     143#if defined(RT_OS_SOLARIS) && defined(VBOX_WITH_HARDENING)
     144                    char achKernArch[128];
     145                    int cbKernArch = sysinfo (SI_ARCHITECTURE_K, achKernArch, sizeof(achKernArch));
     146                    if (cbKernArch > 0)
     147                    {
     148                        sprintf(VBoxSVCPath, "/opt/VirtualBox/%s/%s", achKernArch, VBoxSVC_exe);
     149                        IsVBoxSVCPathSet = true;
     150                    }
     151                    else
     152                        rc = NS_ERROR_UNEXPECTED;
     153#else
    140154                    strcpy (VBoxSVCPath, path.get());
    141155                    RTPathStripFilename (VBoxSVCPath);
     
    143157
    144158                    IsVBoxSVCPathSet = true;
     159#endif
    145160                }
    146161            }
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