Bug 51470

Summary: kde not starting (high kded cpu usage starting mountwatcher)
Product: [Frameworks and Libraries] kdelibs Reporter: lenar
Component: kdedAssignee: Unassigned bugs mailing-list <unassigned-bugs>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:

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;