1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-03 01:17:45 +03:00

[PATCH] update Fedora dev.d/ example and remove unused conf.d/ directory

This commit is contained in:
kay.sievers@vrfy.org 2004-12-07 22:55:08 +01:00 committed by Greg KH
parent c64081980e
commit e4b5f339c7
2 changed files with 45 additions and 22 deletions

View File

@ -1,11 +0,0 @@
# if selinux file attributes
# should be restored (leave to yes, if unsure)
UDEV_SELINUX="yes"
# if console permissions (pam_console)
# should be restored (leave to yes, if unsure)
UDEV_CONSOLE="yes"
# if dbus messages should be sent
UDEV_DBUS="no"

View File

@ -1,18 +1,52 @@
#!/bin/sh
if [ -f /etc/sysconfig/udev ]; then
. /etc/sysconfig/udev
fi
# Fedora solution to set the ownership/permissions of s device to the local
# logged in user. Uses the program pam_console_setowner to match the names of
# the device node and the symlinks against a device list and applies the
# configured ownership and permission to the node.
if [ -f /etc/conf.d/udev ]; then
. /etc/conf.d/udev
fi
[ "$ACTION" != "add" ] && exit 0
[ "$UDEV_CONSOLE" != "yes" ] && exit 0
# we do not have console users in rc.sysinit
[ -n "$IN_INITLOG" ] && exit 0
if [ -x /sbin/pam_console_setowner ]; then
if [ "$UDEV_LOG" = "yes" ] && [ -x /usr/bin/logger ]; then
/usr/bin/logger -p auth.debug "Restoring console permissions for $DEVNAME"
if [ -x /sbin/pam_console_setowner -a -f /var/run/console/console.lock \
-a -e "$DEVNAME" ]; then
if [ -x /usr/bin/logger ]; then
LOGGER=/usr/bin/logger
elif [ -x /bin/logger ]; then
LOGGER=/bin/logger
else
unset LOGGER
fi
exec /sbin/pam_console_setowner $DEVNAME
#
# for diagnostics
#
if [ -t 1 -o -z "$LOGGER" ]; then
mesg () {
echo "$@"
}
else
mesg () {
$LOGGER -t $(basename $0)"[$$]" "$@"
}
fi
debug_mesg () {
test "$udev_log" = "" -o "$udev_log" = "no" && return
mesg "$@"
}
if [ -f /etc/udev/udev.conf ]; then
. /etc/udev/udev.conf
fi
SYMLINKS=""
for i in $(/usr/bin/udevinfo -q symlink -p "$DEVPATH"); do
[ $? -gt 0 ] && break
SYMLINKS="$SYMLINKS ${udev_root%%/}/$i"
done
debug_mesg "Restoring console permissions for $DEVNAME $SYMLINKS"
/sbin/pam_console_setowner "$DEVNAME" $SYMLINKS
fi