VirtualBox

source: vbox/trunk/src/VBox/Installer/linux/debian/postinst

Last change on this file was 104248, checked in by vboxsync, 8 weeks ago

Installer/linux: Don't consider the VirtualBox binary for setuid treatment, the UI is always split now. bugref:9049

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Author Date Id Revision
File size: 3.5 KB
Line 
1#!/bin/sh
2# $Id: postinst 104248 2024-04-09 09:31:05Z vboxsync $
3## @file
4# VirtualBox postinst
5#
6
7#
8# Copyright (C) 2006-2023 Oracle and/or its affiliates.
9#
10# This file is part of VirtualBox base platform packages, as
11# available from https://www.virtualbox.org.
12#
13# This program is free software; you can redistribute it and/or
14# modify it under the terms of the GNU General Public License
15# as published by the Free Software Foundation, in version 3 of the
16# License.
17#
18# This program is distributed in the hope that it will be useful, but
19# WITHOUT ANY WARRANTY; without even the implied warranty of
20# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21# General Public License for more details.
22#
23# You should have received a copy of the GNU General Public License
24# along with this program; if not, see <https://www.gnu.org/licenses>.
25#
26# SPDX-License-Identifier: GPL-3.0-only
27#
28
29# we can be called with the following arguments (6.5 of Debian policy):
30# configure: (our version): installing/configuring new version
31# abort-upgrade: (old version): upgrading to a new version failed
32# abort-remove: (our version): removing this package failed
33# abort-deconfigure: (our version): error during resolving conflicts
34
35## @todo Do we really gain anything from not just executing everything
36## unconditionally?
37
38LOG="/var/log/vbox-install.log"
39
40# defaults
41[ -r /etc/default/virtualbox ] && . /etc/default/virtualbox
42
43if [ "$1" = "configure" ]; then
44
45 # for debconf
46 . /usr/share/debconf/confmodule
47 db_version 2.0
48
49 # remove old cruft
50 if [ -f /etc/init.d/vboxdrv.sh ]; then
51 echo "Found old version of /etc/init.d/vboxdrv.sh, removing."
52 rm /etc/init.d/vboxdrv.sh
53 update-rc.d vboxdrv.sh remove >/dev/null
54 fi
55 if [ -f /etc/vbox/vbox.cfg ]; then
56 echo "Found old version of /etc/vbox/vbox.cfg, removing."
57 rm /etc/vbox/vbox.cfg
58 fi
59
60 # create users groups (disable with INSTALL_NO_GROUP=1 in /etc/default/virtualbox)
61 if [ "$INSTALL_NO_GROUP" != "1" ]; then
62 db_input low virtualbox/group-vboxusers || true
63 db_go || true
64 addgroup --system vboxusers || true
65 fi
66
67 # The starters need to be set-uid-to-root. They drop the privileges before
68 # starting the real frontend.
69 if ! dpkg-statoverride --list /usr/lib/virtualbox/VirtualBoxVM > /dev/null 2>&1; then
70 chmod 4511 /usr/lib/virtualbox/VirtualBoxVM
71 fi
72 if ! dpkg-statoverride --list /usr/lib/virtualbox/VBoxHeadless > /dev/null 2>&1; then
73 chmod 4511 /usr/lib/virtualbox/VBoxHeadless
74 fi
75 if [ -x /usr/lib/virtualbox/VBoxSDL ]; then
76 if ! dpkg-statoverride --list /usr/lib/virtualbox/VBoxSDL > /dev/null 2>&1; then
77 chmod 4511 /usr/lib/virtualbox/VBoxSDL
78 fi
79 fi
80 if ! dpkg-statoverride --list /usr/lib/virtualbox/VBoxNetDHCP > /dev/null 2>&1; then
81 chmod 4511 /usr/lib/virtualbox/VBoxNetDHCP
82 fi
83 if ! dpkg-statoverride --list /usr/lib/virtualbox/VBoxNetNAT > /dev/null 2>&1; then
84 chmod 4511 /usr/lib/virtualbox/VBoxNetNAT
85 fi
86 if ! dpkg-statoverride --list /usr/lib/virtualbox/VBoxNetAdpCtl > /dev/null 2>&1; then
87 chmod 4511 /usr/lib/virtualbox/VBoxNetAdpCtl
88 fi
89 if [ -x /usr/lib/virtualbox/VBoxVolInfo ]; then
90 if ! dpkg-statoverride --list /usr/lib/virtualbox/VBoxVolInfo > /dev/null 2>&1; then
91 chmod 4511 /usr/lib/virtualbox/VBoxVolInfo
92 fi
93 fi
94fi # $1 = "configure"
95
96#DEBHELPER#
97
98if test "${INSTALL_NO_VBOXDRV}" = 1; then
99 POSTINST_START=--nostart
100else
101 POSTINST_START=
102fi
103
104# Install and start the new service scripts.
105/usr/lib/virtualbox/prerm-common.sh || true
106/usr/lib/virtualbox/postinst-common.sh ${POSTINST_START} > /dev/null || true
107
108exit 0
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use