Submitted By: Alexander E. Patrakov (semzx at newmail dot ru) Origin: Alexander E. Patrakov Date: 2003-09-27 Initial Package Version: 3.1.3 Description: implement the logic in the smb kioslave to make smbmounter from kdeaddons work with this kioslave. Earlier it worked with smbro ioslave only. Patch also applies to KDE 3.1.4 Notes: 1) Sorry for the "char samba3_corrupts_memory_here[4096]" hack. Please help debugging. 2) The password is passed as an argument to smbmount. Beware! (This is also true for smbro) diff -ur kdebase-3.1.4.orig/kioslave/smb/kio_smb.h kdebase-3.1.4/kioslave/smb/kio_smb.h --- kdebase-3.1.4.orig/kioslave/smb/kio_smb.h 2003-09-09 00:40:26.000000000 +0600 +++ kdebase-3.1.4/kioslave/smb/kio_smb.h 2003-09-27 12:51:02.000000000 +0600 @@ -267,6 +267,7 @@ void readOutput(KProcess *proc, char *buffer, int buflen); private: + char samba3_corrupts_memory_here[4096]; QString mybuf; }; diff -ur kdebase-3.1.4.orig/kioslave/smb/kio_smb_mount.cpp kdebase-3.1.4/kioslave/smb/kio_smb_mount.cpp --- kdebase-3.1.4.orig/kioslave/smb/kio_smb_mount.cpp 2003-06-24 12:29:58.000000000 +0600 +++ kdebase-3.1.4/kioslave/smb/kio_smb_mount.cpp 2003-09-27 13:00:31.000000000 +0600 @@ -54,7 +54,7 @@ } if (tmp==3) { - if (!KStandardDirs::makeDir(mountPoint)) { + if (!KStandardDirs::makeDir(mountPoint,0700)) { error(KIO::ERR_COULD_NOT_MKDIR, mountPoint); return; } @@ -62,11 +62,12 @@ mybuf.truncate(0); KProcess proc; - proc << "mount"; - proc << "-o guest"; - proc << "-t smbfs"; + proc << "smbmount"; proc << remotePath.local8Bit(); proc << mountPoint.local8Bit(); + QString autharg = "-o username=" + user; + autharg += ",password=" + password; + proc << autharg.local8Bit(); connect(&proc, SIGNAL( receivedStdout(KProcess *, char *, int )), SLOT(readOutput(KProcess *, char *, int))); @@ -85,47 +86,22 @@ case 2: case 4: { -/* QString mountPoint; + QString mountPoint; stream >> mountPoint; - ClientProcess proc; - QCStringList args; - args<0) - kdDebug(KIO_SMB)<<"Smb::waitUntilStarted(): received: -"<