Recommendations for avoiding a bug in devfs?
I just reported a bug in devfs (Radar 3330941) that makes it impossible to add a device that contains an intermediate path. Say I wanted to add a device foo/bar, i.e. full path /dev/foo/bar. When I call devfs_make_node() with the "foo/bar" path, devfs_make_node() calls dev_finddir() with "foo" to create the intermediate directory. dev_finddir() then copies the string "foo" into its private 'component' string, but forgets to add a terminating '\0' character. The result is a directory in /dev with a name that starts with "foo", but has some random junk on the end. Sure enough, if you manage to list this directory, the device "bar" will be inside. I need to work around this bug, and I was wondering if anyone else has already done so. Is it possible to add a device "foo" with dummy properties, then add a child device "bar" to it separately? If not, is my only option to include my own fixed version of these functions in my code? The product I'm building is only targetting Jaguar, so I'm not concerned about the fact that this will probably break on future builds of Darwin. Thanks in advance for any suggestions, Sam _______________________________________________ darwin-kernel mailing list | darwin-kernel@lists.apple.com Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-kernel Do not post admin requests to the list. They will be ignored.
participants (1)
-
Sam Vaughan