[Bug 18293] New: hald caught in infinite loop while scanning directory
bugzilla-daemon at bugzilla.ubuntu.com
bugzilla-daemon at bugzilla.ubuntu.com
Sat Oct 22 15:42:12 UTC 2005
Please do not reply to this email. You can add comments at
http://bugzilla.ubuntu.com/show_bug.cgi?id=18293
Ubuntu | hal
Summary: hald caught in infinite loop while scanning directory
Product: Ubuntu
Version: unspecified
Platform: i386
OS/Version: Linux
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: hal
AssignedTo: martin.pitt at ubuntu.com
ReportedBy: torsten.scheck at gmx.de
QAContact: desktop-bugs at lists.ubuntu.com
System: Ubuntu 5.10 "Breezy Badger"
Package: 0.5.3-0ubuntu14
Starting /etc/dbus-1/event.d/20hal causes an infinite loop, when scanning the
directory
/usr/share/hal/fdi due to the processing of dot entries (strace shows:
stat64("/usr/share/hal/fdi/preprobe/././././././././././././././././././././
[...] ).
The patch below excludes all dot files and directories.
BTW: According to the scandir manpage, scandir is not POSIX conform. You might
consider replacing it with an appropriate function.
hal-0.5.3/debian/patches/hald-scandir-nodots.patch
----------------------8<----------------------8<----------------------
diff -ru hal-0.5.3.orig/hald/device_info.c hal-0.5.3/hald/device_info.c
--- hal-0.5.3.orig/hald/device_info.c 2005-10-22 16:01:14.000000000 +0200
+++ hal-0.5.3/hald/device_info.c 2005-10-22 16:04:20.000000000 +0200
@@ -1324,6 +1324,13 @@
* @param d Device to merge information into
* @return #TRUE if information was merged
*/
+
+static int
+dotfilter(const struct dirent *d)
+{
+ return d->d_name[0]!='.';
+}
+
static dbus_bool_t
scan_fdi_files (const char *dir, HalDevice * d)
{
@@ -1335,8 +1342,8 @@
found_fdi_file = 0;
/*HAL_INFO(("scan_fdi_files: Processing dir '%s'", dir));*/
-
- num_entries = scandir (dir, &name_list, 0, my_alphasort);
+
+ num_entries = scandir (dir, &name_list, dotfilter, my_alphasort);
if (num_entries == -1) {
perror ("scandir");
return FALSE;
----------------------8<----------------------8<----------------------
--
Configure bugmail: http://bugzilla.ubuntu.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.
More information about the desktop-bugs
mailing list