Bug 217651 - devfs: adding an improper ruleset, e.g. one that has improperly quoted globs, are hard to delete
Summary: devfs: adding an improper ruleset, e.g. one that has improperly quoted globs,...
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-09 00:27 UTC by Enji Cooper
Modified: 2017-03-09 00:27 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Enji Cooper freebsd_committer 2017-03-09 00:27:16 UTC
Repro:

Run the following commands as root:

1. Add a bogus ruleset with improperly quoted paths for "/dev/pass*" and "/dev/xpt*" (change 20/21 to another ruleset that's not currently taken):

# cat >> /etc/devfs.rules <<'EOF'
[devfsrules_modify_perms_for_wheel=20]
add path pass* mode 660 group wheel
add path xpt* mode 660 group wheel

[devfsrules_modify_perms_for_wheel=21]
add path "pass*" mode 660 group wheel
add path "xpt*" mode 660 group wheel
EOF

2. Run /etc/rc.d/devfs, e.g., "service devfs start".
3. Verify that the ruleset has been added:

# devfs rule showsets | egrep '^2[01]$'
20
21
#

4. Try deleting the newly added rulesets, e.g.,

# devfs rule -s 20 delset
# devfs rule -s 21 delset

5. Verify that they've been deleted by rerunning the command in 3.

Expected results:

Both rulesets should be deleted.

Actual results:

Ruleset 20 remains:

# devfs rule showsets | egrep '^2[01]$'
20