linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* udev  silently ignores bad config file names
@ 2004-05-22 21:16 Erik Søe Sørensen
  0 siblings, 0 replies; 2+ messages in thread
From: Erik Søe Sørensen @ 2004-05-22 21:16 UTC (permalink / raw)
  To: linux-hotplug

[-- Attachment #1: Type: text/plain, Size: 1257 bytes --]

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

[-- Attachment #2: namedev.c.diff --]
[-- Type: text/plain, Size: 486 bytes --]

--- 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();

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: udev  silently ignores bad config file names
@ 2004-06-04 21:17 Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2004-06-04 21:17 UTC (permalink / raw)
  To: linux-hotplug

On Sat, May 22, 2004 at 11:16:45PM +0200, Erik S?e S?rensen wrote:
> 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 agree, care to change this to report which file could not be read?

> - I don't know if the error report should go to stderr, the log, or 
> both.

There is no stderr when udev is running :)
The log is all we have.

> - Finally, I'm not sure how much sense it makes that the permissions 
> file is not attempted read if reading the rules file failed..?

We should plod onward, as the user could just be relying on the default
permission and root:root ownership, as is the case for the root disk
when booting in a initrd/initramfs image.

thanks,

greg k-h


-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
From Windows to Linux, servers to mobile, InstallShield X is the one
installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504
_______________________________________________
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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-06-04 21:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-04 21:17 udev silently ignores bad config file names Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2004-05-22 21:16 Erik Søe Sørensen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).