udev silently ignores bad config file names
Hi there.
In udev-025, bad config file names for rules and permissions are silently ignored. Worse yet: even if the permission config file name is correct, the file won't be loaded if the rules file name is incorrect (e.g., doesn't exist).
A crude fix is attached. It just reports that there are problems with reading a certain config file; this could of course be improved a lot.
- The nature of the error should be written.
- I don't know if the error report should go to stderr, the log, or both. It would probably be a good thing if the error message is shown when udev is run; on the other hand, udev is usually run from a script which executes it many (~100) times in a row, and I guess that's too many repeated error messages for anyone. One solutionish thing is to have the script first run udev with ACTION=check, causing udev to report problems with config files, while being silent the rest of the time (but that's not so appropriate for single udev runs). Another is to let the script collect the error messages and write out a summary when it's done.
- Finally, I'm not sure how much sense it makes that the permissions file is not attempted read if reading the rules file failed..?
Erik Søe Sørensen
namedev.c renamed from namedev.c.org +6 -2
@@ -891,12 +891,16 @@int retval; retval =namedev_init_rules (); -if (retval) +if (retval) { +info ("Couldn't read rules" );/* TODO: Tell more */ return retval; + } retval =namedev_init_permissions (); -if (retval) +if (retval) { +info ("Couldn't read permissions" );/* TODO: Tell more */ return retval; + }dump_config_dev_list ();dump_perm_dev_list ();