From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?ISO-8859-1?Q?Erik_S=F8e_S=F8rensen?= Date: Sat, 22 May 2004 21:16:45 +0000 Subject: udev silently ignores bad config file names Message-Id: <40AFC33D.4040203@daimi.au.dk> MIME-Version: 1 Content-Type: multipart/mixed; boundary="------------020200080006070508070105" List-Id: To: linux-hotplug@vger.kernel.org This is a multi-part message in MIME format. --------------020200080006070508070105 Content-Type: text/plain; charset="iso-8859-1"; format="flowed" Content-Transfer-Encoding: quoted-printable Hi there. In udev-025, bad config file names for rules and permissions are=20 silently ignored. Worse yet: even if the permission config file name is=20 correct, the file won't be loaded if the rules file name is incorrect=20 (e.g., doesn't exist). A crude fix is attached. It just reports that there are problems with=20 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=20 both. It would probably be a good thing if the error message is shown=20 when udev is run; on the other hand, udev is usually run from a script=20 which executes it many (~100) times in a row, and I guess that's too=20 many repeated error messages for anyone. One solutionish thing is to have the script first run udev with=20 ACTION=3Dcheck, causing udev to report problems with config files, while=20 being silent the rest of the time (but that's not so appropriate for=20 single udev runs). Another is to let the script collect the error=20 messages and write out a summary when it's done. - Finally, I'm not sure how much sense it makes that the permissions=20 file is not attempted read if reading the rules file failed..? Erik S=F8e S=F8rensen --------------020200080006070508070105 Content-Type: text/plain; name="namedev.c.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="namedev.c.diff" --- namedev.c.org 2004-05-22 22:37:21.270829461 +0200 +++ namedev.c 2004-05-22 22:35:50.461506659 +0200 @@ -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(); --------------020200080006070508070105-- ------------------------------------------------------- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel