]>
git.proxmox.com Git - mirror_lxc.git/blob - src/lxc/lxc-setuid.in
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.
29 echo "usage: $(basename $0) [-d]" >&2
35 echo "Set or drop the setuid attribute on the lxc tools." >&2
38 echo " -d drop the setuid attribute" >&2
43 if [ "$1" = "-r" ]; then
52 setuid @BINDIR@
/lxc-attach
53 setuid @BINDIR@
/lxc-create
54 setuid @BINDIR@
/lxc-execute
55 setuid @BINDIR@
/lxc-start
56 setuid @BINDIR@
/lxc-restart
57 setuid @BINDIR@
/lxc-unshare
58 setuid @BINDIR@
/lxc-netstat
59 setuid @BINDIR@
/lxc-checkpoint
60 setuid @LXCINITDIR@
/lxc-init
62 test -e @LXCPATH@ || mkdir
-p @LXCPATH@
68 setuid
-r @BINDIR@
/lxc-attach
69 setuid
-r @BINDIR@
/lxc-create
70 setuid
-r @BINDIR@
/lxc-execute
71 setuid
-r @BINDIR@
/lxc-start
72 setuid
-r @BINDIR@
/lxc-restart
73 setuid
-r @BINDIR@
/lxc-unshare
74 setuid
-r @BINDIR@
/lxc-netstat
75 setuid
-r @BINDIR@
/lxc-checkpoint
76 setuid
-r @LXCINITDIR@
/lxc-init
84 getopt
=$
(getopt
-o $shortoptions --longoptions $longoptions -- "$@")
113 if [ "$(id -u)" != "0" ]; then
114 echo "$(basename $0): must be run as root" >&2
118 if [ -z "$LXC_DROP_CAPS" ]; then