Bug 51470 - kde not starting (high kded cpu usage starting mountwatcher)
Summary: kde not starting (high kded cpu usage starting mountwatcher)
Status: RESOLVED FIXED
Alias: None
Product: kdelibs
Classification: Frameworks and Libraries
Component: kded (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-12-03 20:18 UTC by lenar
Modified: 2003-01-08 18:22 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description lenar 2002-12-03 20:18:57 UTC
Version:            (using KDE KDE 3.0.9)
Installed from:    Unlisted Binary Package
OS:          Linux

When kded is starting up mountwatcher it ends up infinite loop
trying to stat() for example /dev/cdrom which is symlink to itself.
I know this is itself errorneus situation, but it was somehow created
and ordinary user just thinks KDE is shit if such things happen and 
nothing is said to user.
Please apply some checks to prevent this.
Comment 1 Waldo Bastian 2003-01-08 18:22:18 UTC
Subject: kdebase/kioslave/devices/kdedmodule

CVS commit by waba: 

CCMAIL: 51470-done@bugs.kde.org
Don't hang on cyclic symlinks


  M +2 -2      disks.cpp   1.24


--- kdebase/kioslave/devices/kdedmodule/disks.cpp  #1.23:1.24
@@ -26,4 +26,5 @@
 
 #include <kglobal.h>
+#include <kstandarddirs.h>
 #include <kdebug.h>
 #include <qfileinfo.h>
@@ -167,6 +168,5 @@ void DiskEntry::setDeviceName(const QStr
  if (deviceName.startsWith("/dev/"))
  {
-        for (QFileInfo finfo=QFileInfo(realDevice);finfo.isSymLink();finfo=QFileInfo(realDevice))
-                realDevice=finfo.readLink();
+        realDevice=KStandardDirs::realPath(deviceName);
 
         kdDebug(7020)<<"Device "<<deviceName<<" is a actually "<<realDevice<<endl;