diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-12-11 20:21:27 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-12-11 20:21:27 +0000 |
commit | 10e41144596fc9ced40fc349d9ecd099b1c2ea19 (patch) | |
tree | 88ab04e475ff5a4cd889cb082f5760b6e0bf5e4e /kcontrol/input/consoleUserPerms | |
parent | 4aed2c8219774f5d797760606b8489a92ddc5163 (diff) | |
download | tdebase-10e41144596fc9ced40fc349d9ecd099b1c2ea19.tar.gz tdebase-10e41144596fc9ced40fc349d9ecd099b1c2ea19.zip |
Initial import of Trinity 3.5.11 to kdebase
Extends krandrtray, adds iccconfig kcontrol module, adds run dialog autocomplete and lots of bugfixes
Will need to check for commit warnings and repair as encountered
Also needs full compile test
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1061475 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kcontrol/input/consoleUserPerms')
-rwxr-xr-x | kcontrol/input/consoleUserPerms | 50 |
1 files changed, 12 insertions, 38 deletions
diff --git a/kcontrol/input/consoleUserPerms b/kcontrol/input/consoleUserPerms index 015df642f..af7e267bd 100755 --- a/kcontrol/input/consoleUserPerms +++ b/kcontrol/input/consoleUserPerms @@ -1,42 +1,16 @@ -#!/bin/bash -# -# /etc/hotplug/usb/consoleUserPerms -# -# Sets up newly plugged in USB device so that the user who owns -# the console according to pam_console can access it from user space -# -# Note that for this script to work, you'll need all of the following: -# a) a line in the file /etc/hotplug/usb.usermap or another usermap file -# in /etc/hotplug/usb/ that corresponds to the device you are using. -# b) a setup using pam_console creates the respective lock files -# containing the name of the respective user. You can check for that -# by executing "echo `cat /var/{run,lock}/console.lock`" and -# verifying the appropriate user is mentioned somewhere there. -# c) a Linux kernel supporting hotplug and usbdevfs -# d) the hotplug package (http://linux-hotplug.sourceforge.net/) -# -# In the usermap file, the first field "usb module" should be named -# "consoleUserPerms" to invoke this script. -# +#!/bin/sh -if [ "${ACTION}" = "add" ] && [ -f "${DEVICE}" ] +GROUP=plugdev + +if [ "${ACTION}" = "add" ] then - # New code, using lock files instead of copying /dev/console permissions - # This also works with non-kdm logins (e.g. on a virtual terminal) - # Idea and code from Nalin Dahyabhai <nalin@redhat.com> - if [ -f /var/run/console.lock ] - then - CONSOLEOWNER=`cat /var/run/console.lock` - elif [ -f /var/lock/console.lock ] - then - CONSOLEOWNER=`cat /var/lock/console.lock` - else - CONSOLEOWNER= - fi - if [ -n "$CONSOLEOWNER" ] - then - chmod 0000 "${DEVICE}" - chown "$CONSOLEOWNER" "${DEVICE}" - chmod 0600 "${DEVICE}" + if getent group $GROUP > /dev/null; then + N=0 + while [ ! -e $DEVICE ] && [ $N -lt 25 ]; do + sleep 1 + N=$(expr $N + 1) + done + chmod 660 "${DEVICE}" + chown root:$GROUP "${DEVICE}" fi fi |