|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From 9158d03e4042876b7627947b3489fd4d49c7553a Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From: Tom Gundersen <teg@jklm.no>
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Date: Sat, 20 Sep 2014 18:12:53 +0200
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Subject: [PATCH] test: udev - restrict nemuric uid's to existing ones
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
We now verify the existence of uid's before applying them to devicenodes, so change the
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
test accordingly. We assume that both uid/gid 1 and 2 exist on the test system.
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
test/udev-test.pl | 62 +++++++++++++++++++++++++++----------------------------
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
1 file changed, 31 insertions(+), 31 deletions(-)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
diff --git a/test/udev-test.pl b/test/udev-test.pl
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
index 23f1b726e0..14f11df8af 100755
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
--- a/test/udev-test.pl
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+++ b/test/udev-test.pl
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -549,21 +549,21 @@ KERNEL=="tty33", OWNER="bad", GROUP="name"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
EOF
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
},
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
{
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- desc => "permissions OWNER=5000",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ desc => "permissions OWNER=1",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
exp_name => "node",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- exp_perms => "5000::0600",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ exp_perms => "1::0600",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
rules => <
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
-SUBSYSTEMS=="scsi", KERNEL=="sda", SYMLINK+="node", OWNER="5000"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+SUBSYSTEMS=="scsi", KERNEL=="sda", SYMLINK+="node", OWNER="1"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
EOF
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
},
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
{
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- desc => "permissions GROUP=100",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ desc => "permissions GROUP=1",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
exp_name => "node",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- exp_perms => ":100:0660",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ exp_perms => ":1:0660",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
rules => <
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
-SUBSYSTEMS=="scsi", KERNEL=="sda", SYMLINK+="node", GROUP="100"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+SUBSYSTEMS=="scsi", KERNEL=="sda", SYMLINK+="node", GROUP="1"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
EOF
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
},
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
{
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -603,30 +603,30 @@ SUBSYSTEMS=="scsi", KERNEL=="sda", SYMLINK+="node", MODE="0777"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
EOF
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
},
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
{
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- desc => "permissions OWNER=5000 GROUP=100 MODE=0777",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ desc => "permissions OWNER=1 GROUP=1 MODE=0777",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
exp_name => "node",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- exp_perms => "5000:100:0777",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ exp_perms => "1:1:0777",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
rules => <
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
-SUBSYSTEMS=="scsi", KERNEL=="sda", SYMLINK+="node", OWNER="5000", GROUP="100", MODE="0777"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+SUBSYSTEMS=="scsi", KERNEL=="sda", SYMLINK+="node", OWNER="1", GROUP="1", MODE="0777"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
EOF
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
},
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
{
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- desc => "permissions OWNER to 5000",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ desc => "permissions OWNER to 1",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
devpath => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
exp_name => "ttyACM0",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- exp_perms => "5000::",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ exp_perms => "1::",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
rules => <
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
-KERNEL=="ttyACM[0-9]*", SYMLINK+="ttyACM%n", OWNER="5000"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+KERNEL=="ttyACM[0-9]*", SYMLINK+="ttyACM%n", OWNER="1"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
EOF
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
},
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
{
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- desc => "permissions GROUP to 100",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ desc => "permissions GROUP to 1",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
devpath => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
exp_name => "ttyACM0",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- exp_perms => ":100:0660",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ exp_perms => ":1:0660",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
rules => <
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
-KERNEL=="ttyACM[0-9]*", SYMLINK+="ttyACM%n", GROUP="100"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+KERNEL=="ttyACM[0-9]*", SYMLINK+="ttyACM%n", GROUP="1"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
EOF
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
},
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
{
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -642,19 +642,19 @@ EOF
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
desc => "permissions OWNER, GROUP, MODE",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
devpath => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
exp_name => "ttyACM0",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- exp_perms => "5000:100:0777",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ exp_perms => "1:1:0777",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
rules => <
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
-KERNEL=="ttyACM[0-9]*", SYMLINK+="ttyACM%n", OWNER="5000", GROUP="100", MODE="0777"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+KERNEL=="ttyACM[0-9]*", SYMLINK+="ttyACM%n", OWNER="1", GROUP="1", MODE="0777"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
EOF
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
},
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
{
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
desc => "permissions only rule",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
devpath => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
exp_name => "ttyACM0",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- exp_perms => "5000:100:0777",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ exp_perms => "1:1:0777",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
rules => <
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
-KERNEL=="ttyACM[0-9]*", OWNER="5000", GROUP="100", MODE="0777"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
-KERNEL=="ttyUSX[0-9]*", OWNER="5001", GROUP="101", MODE="0444"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+KERNEL=="ttyACM[0-9]*", OWNER="1", GROUP="1", MODE="0777"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+KERNEL=="ttyUSX[0-9]*", OWNER="2", GROUP="2", MODE="0444"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
KERNEL=="ttyACM[0-9]*", SYMLINK+="ttyACM%n"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
EOF
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
},
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -662,12 +662,12 @@ EOF
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
desc => "multiple permissions only rule",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
devpath => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
exp_name => "ttyACM0",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- exp_perms => "3000:4000:0777",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ exp_perms => "1:1:0777",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
rules => <
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
-SUBSYSTEM=="tty", OWNER="3000"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
-SUBSYSTEM=="tty", GROUP="4000"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+SUBSYSTEM=="tty", OWNER="1"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+SUBSYSTEM=="tty", GROUP="1"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
SUBSYSTEM=="tty", MODE="0777"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
-KERNEL=="ttyUSX[0-9]*", OWNER="5001", GROUP="101", MODE="0444"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+KERNEL=="ttyUSX[0-9]*", OWNER="2", GROUP="2", MODE="0444"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
KERNEL=="ttyACM[0-9]*", SYMLINK+="ttyACM%n"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
EOF
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
},
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -675,13 +675,13 @@ EOF
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
desc => "permissions only rule with override at SYMLINK+ rule",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
devpath => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
exp_name => "ttyACM0",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- exp_perms => "3000:8000:0777",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ exp_perms => "1:2:0777",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
rules => <
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
-SUBSYSTEM=="tty", OWNER="3000"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
-SUBSYSTEM=="tty", GROUP="4000"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+SUBSYSTEM=="tty", OWNER="1"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+SUBSYSTEM=="tty", GROUP="1"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
SUBSYSTEM=="tty", MODE="0777"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
-KERNEL=="ttyUSX[0-9]*", OWNER="5001", GROUP="101", MODE="0444"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
-KERNEL=="ttyACM[0-9]*", SYMLINK+="ttyACM%n", GROUP="8000"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+KERNEL=="ttyUSX[0-9]*", OWNER="2", GROUP="2", MODE="0444"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+KERNEL=="ttyACM[0-9]*", SYMLINK+="ttyACM%n", GROUP="2"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
EOF
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
},
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
{
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -1274,11 +1274,11 @@ EOF
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
desc => "TEST PROGRAM feeds OWNER, GROUP, MODE",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
exp_name => "sda",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- exp_perms => "5000:100:0400",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ exp_perms => "1:1:0400",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
exp_rem_error => "yes",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
rules => <
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
KERNEL=="sda", MODE="666"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
-KERNEL=="sda", PROGRAM=="/bin/echo 5000 100 0400", OWNER="%c{1}", GROUP="%c{2}", MODE="%c{3}"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+KERNEL=="sda", PROGRAM=="/bin/echo 1 1 0400", OWNER="%c{1}", GROUP="%c{2}", MODE="%c{3}"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
EOF
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
},
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
{
|