Summary: | KDE desktop icon mounts for smb shares with special characters in name do not work properly | ||
---|---|---|---|
Product: | kdesktop | Reporter: | spamalam |
Component: | general | Assignee: | David Faure <faure> |
Status: | CLOSED FIXED | ||
Severity: | normal | CC: | finex |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
spamalam
2002-07-15 23:32:43 UTC
I had a similar setup with KDE 3.1RC. with an escaped space in a samba share name in /etc/fstab. I mounted it fine from a desktop icon click. So, "Works for me". This was with some Debian/woody packages. Subject: kdebase/kioslave/devices CVS commit by waba: CCMAIL: 45274-done@bugs.kde.org Fix handling of mountpoints with spaces (BR45274) M +2 -0 configure.in.in 1.4 M +48 -4 kdedmodule/disklist.cpp 1.11 --- kdebase/kioslave/devices/configure.in.in #1.3:1.4 @@ -21,2 +21,4 @@ AM_CONDITIONAL(include_devicesdir, test -n "$DEVICESDIR") + +AC_CHECK_FUNCS(setmntent) --- kdebase/kioslave/devices/kdedmodule/disklist.cpp #1.10:1.11 @@ -37,4 +37,9 @@ #define FULL_PERCENT 95.0 +#ifdef HAVE_MNTENT_H +#include <mntent.h> +#endif + + /*************************************************************************** * constructor @@ -90,5 +95,43 @@ int DiskList::readFSTAB() if (readingDFStdErrOut || dfProc->isRunning()) return -1; -QFile f(FSTAB); +#ifdef HAVE_SETMNTENT + +#define SETMNTENT setmntent +#define ENDMNTENT endmntent +#define STRUCT_MNTENT struct mntent * +#define STRUCT_SETMNTENT FILE * +#define GETMNTENT(file, var) ((var = getmntent(file)) != 0) +#define MOUNTPOINT(var) var->mnt_dir +#define MOUNTTYPE(var) var->mnt_type +#define MOUNTOPTIONS(var) var->mnt_opts +#define HASMNTOPT(var, opt) hasmntopt(var, opt) +#define FSNAME(var) var->mnt_fsname + + STRUCT_SETMNTENT fstab; + if ((fstab = SETMNTENT(FSTAB, "r")) == 0) + return -1; + + STRUCT_MNTENT fe; + while (GETMNTENT(fstab, fe)) + { + DiskEntry *disk = new DiskEntry(); + disk->setMounted(FALSE); + disk->setDeviceName(QFile::decodeName(FSNAME(fe))); + //kdDebug() << " deviceName: [" << disk->deviceName() << "]" << endl; + disk->setMountPoint(QFile::decodeName(MOUNTPOINT(fe))); + //kdDebug() << " MountPoint: [" << disk->mountPoint() << "]" << endl; + disk->setFsType(QFile::decodeName(MOUNTTYPE(fe))); + //kdDebug() << " FS-Type: [" << disk->fsType() << "]" << endl; + disk->setMountOptions(QFile::decodeName(MOUNTOPTIONS(fe))); + //kdDebug() << " Mount-Options: [" << disk->mountOptions() << "]" << endl; + if (!ignoreDisk(disk)) + replaceDeviceEntry(disk); + else + delete disk; + } + ENDMNTENT(fstab); + +#else + QFile f(FSTAB); if ( f.open(IO_ReadOnly) ) { QTextStream t (&f); @@ -132,4 +175,5 @@ QFile f(FSTAB); f.close(); } //if f.open +#endif // kdDebug() << "DiskList::readFSTAB DONE" << endl; @@ -276,6 +320,6 @@ void DiskList::dfDone() s=s.remove(0,s.find(BLANK)+1 ); // delete the capacity 94% - disk->setMountPoint(s.left(s.find(BLANK)) ); - s=s.remove(0,s.find(BLANK)+1 ); + s=s.stripWhiteSpace(); + disk->setMountPoint(s ); //kdDebug() << " MountPoint: [" << disk->mountPoint() << "]" << endl; Bug closed. Kdesktop is no more mantained. |