4
# lxc: linux Container library
7
# Daniel Lezcano <daniel.lezcano@free.fr>
9
# This library is free software; you can redistribute it and/or
10
# modify it under the terms of the GNU Lesser General Public
11
# License as published by the Free Software Foundation; either
12
# version 2.1 of the License, or (at your option) any later version.
14
# This library is distributed in the hope that it will be useful,
15
# but WITHOUT ANY WARRANTY; without even the implied warranty of
16
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
# Lesser General Public License for more details.
19
# You should have received a copy of the GNU Lesser General Public
20
# License along with this library; if not, write to the Free Software
21
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24
# This script allows to set or remove the setuid execution bit on the lxc tools.
25
# When the capabilities are set, a non root user can manage the containers.
30
echo "lxc-setuid [-d] : set or remove setuid on the lxc tools"
35
if [ "$1" = "-r" ]; then
44
setuid @BINDIR@/lxc-attach
45
setuid @BINDIR@/lxc-create
46
setuid @BINDIR@/lxc-execute
47
setuid @BINDIR@/lxc-start
48
setuid @BINDIR@/lxc-restart
49
setuid @BINDIR@/lxc-unshare
50
setuid @BINDIR@/lxc-netstat
51
setuid @BINDIR@/lxc-checkpoint
52
setuid @LXCINITDIR@/lxc-init
54
test -e @LXCPATH@ || mkdir -p @LXCPATH@
60
setuid -r @BINDIR@/lxc-attach
61
setuid -r @BINDIR@/lxc-create
62
setuid -r @BINDIR@/lxc-execute
63
setuid -r @BINDIR@/lxc-start
64
setuid -r @BINDIR@/lxc-restart
65
setuid -r @BINDIR@/lxc-unshare
66
setuid -r @BINDIR@/lxc-netstat
67
setuid -r @BINDIR@/lxc-checkpoint
68
setuid -r @LXCINITDIR@/lxc-init
73
if [ "$(id -u)" != "0" ]; then
74
echo "You have to be root to run this script"
84
set -- $(getopt dh $*)
107
if [ -z "$LXC_DROP_CAPS" ]; then
b'\\ No newline at end of file'