Hackfut Security File Manager
Current Path:
/lib/udev
lib
/
udev
/
📁
..
📄
ata_id
(30.02 KB)
📄
cdrom_id
(38.02 KB)
📄
collect
(14.03 KB)
📄
console_check
(7.3 KB)
📄
console_init
(11.78 KB)
📄
create_floppy_devices
(50.24 KB)
📁
devices
📄
edd_id
(22.02 KB)
📄
findkeyboards
(1.75 KB)
📄
firmware.sh
(745 B)
📄
fstab_import
(22.02 KB)
📄
fw_unit_symlinks.sh
(686 B)
📄
hid2hci
(42.03 KB)
📄
keyboard-force-release.sh
(502 B)
📄
keymap
(66.02 KB)
📁
keymaps
📄
modem-modeswitch
(22.4 KB)
📄
mpath-iosched.sh
(754 B)
📄
path_id
(42.03 KB)
📄
pci-db
(38.03 KB)
📄
pcmcia-check-broken-cis
(10.75 KB)
📄
pcmcia-socket-startup
(40.19 KB)
📄
rename_device
(9.52 KB)
📄
rule_generator.functions
(2.33 KB)
📁
rules.d
📄
sas_path_id
(38.03 KB)
📄
scsi_id
(34.55 KB)
📄
tuned-mpath-iosched
(953 B)
📄
tuned-request-ktune-restart
(193 B)
📄
udev-acl
(46.03 KB)
📄
udev-kvm-check
(1.09 KB)
📄
usb-db
(38.03 KB)
📄
usb_id
(46.05 KB)
📄
v4l_id
(10.02 KB)
📄
write_cd_rules
(2.64 KB)
📄
write_net_rules
(4.63 KB)
Editing: rule_generator.functions
# functions used by the udev rule generator # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation version 2 of the License. PATH='/sbin:/bin' # Read a single line from file $1 in the $DEVPATH directory. # The function must not return an error even if the file does not exist. sysread() { local file="$1" [ -e "/sys$DEVPATH/$file" ] || return 0 local value read value < "/sys$DEVPATH/$file" || return 0 echo "$value" } sysreadlink() { local file="$1" [ -e "/sys$DEVPATH/$file" ] || return 0 readlink -f /sys$DEVPATH/$file 2> /dev/null || true } # Return true if a directory is writeable. writeable() { if ln -s test-link $1/.is-writeable 2> /dev/null; then rm -f $1/.is-writeable return 0 else return 1 fi } # Create a lock file for the current rules file. lock_rules_file() { [ -e /dev/.udev/ ] || return 0 RULES_LOCK="/dev/.udev/.lock-${RULES_FILE##*/}" retry=30 while ! mkdir $RULES_LOCK 2> /dev/null; do if [ $retry -eq 0 ]; then echo "Cannot lock $RULES_FILE!" >&2 exit 2 fi sleep 1 retry=$(($retry - 1)) done } unlock_rules_file() { [ "$RULES_LOCK" ] || return 0 rmdir $RULES_LOCK || true } # Choose the real rules file if it is writeable or a temporary file if not. # Both files should be checked later when looking for existing rules. choose_rules_file() { local tmp_rules_file="/dev/.udev/tmp-rules--${RULES_FILE##*/}" [ -e "$RULES_FILE" -o -e "$tmp_rules_file" ] || PRINT_HEADER=1 if writeable ${RULES_FILE%/*}; then RO_RULES_FILE='/dev/null' else RO_RULES_FILE=$RULES_FILE RULES_FILE=$tmp_rules_file fi } # Return the name of the first free device. raw_find_next_available() { local links="$*" local basename=${links%%[ 0-9]*} local max=-1 for name in $links; do local num=${name#$basename} [ "$num" ] || num=0 [ $num -gt $max ] && max=$num done local max=$(($max + 1)) # "name0" actually is just "name" [ $max -eq 0 ] && return echo "$max" } # Find all rules matching a key (with action) and a pattern. find_all_rules() { local key="$1" local linkre="$2" local match="$3" local search='.*[[:space:],]'"$key"'"('"$linkre"')".*' echo $(sed -n -r -e 's/^#.*//' -e "${match}s/${search}/\1/p" \ $RO_RULES_FILE \ $([ -e $RULES_FILE ] && echo $RULES_FILE) \ 2>/dev/null) }
Upload File
Create Folder