summaryrefslogtreecommitdiff
path: root/packages/keylaunch/files/80chvt-SUID
blob: e3b4efef5de075527c4415a2aeb7dbf17d6dce11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#! /bin/sh
#
# Copyright Matthias Hentges <devel@hentges.net> (c) 2006
# License: GPL (see http://www.gnu.org/licenses/gpl.txt for a copy of the license)
#
# Filename: chvt-SUID.sh
# Date: 28-May-06


#
# Sets the SUID bit on chvt to allow changing to the VT from inside X by
# any user. Since a SUID binary still is a security risk, we chmod only
# when keylaunch is used and not by default.
#

for target in /usr/bin/chvt.console-tools
do
	if test "`ls -l "$target" | awk '{print $1}'|cut -c 2-4`" != "rws" 
	then
		echo "Making [$target] SUID root..."
		chmod u+s "$target"
	else
		echo "Ignoring [$target]"
	fi
done