Hello,
winpopup protocol from kde svn dont work on kubuntu intrepid with
latest version of deb package samba and deb packages kde4.

In kubuntu intrepid ibex doesnt work command kdesu. Works only kdesudo.
In smbclient doesn't work at the end of command char "-".

I fix it and write debug info about smbclient.
I'm sending winpopup patch.

-- 
Pali Rohár
[EMAIL PROTECTED]

Index: kdenetwork/kopete/protocols/winpopup/libwinpopup/libwinpopup.cpp
===================================================================
--- kdenetwork/kopete/protocols/winpopup/libwinpopup/libwinpopup.cpp	(revision 887694)
+++ kdenetwork/kopete/protocols/winpopup/libwinpopup/libwinpopup.cpp	(working copy)
@@ -111,7 +111,7 @@
 		                                          QString::fromLatin1("Winpopup"), KGuiItem(i18n("Create Directory")), KGuiItem(i18n("Do Not Create")));
 		if (tmpYesNo == KMessageBox::Yes) {
 			QStringList kdesuArgs = QStringList(QString("-c mkdir -p -m 0777 " + WP_POPUP_DIR));
-			if (KToolInvocation::kdeinitExecWait("kdesu", kdesuArgs) == 0) return true;
+			if (KToolInvocation::kdeinitExecWait("kdesudo", kdesuArgs) == 0) return true;
 		}
 	} else {
 		KFileItem tmpFileItem = KFileItem(KFileItem::Unknown, KFileItem::Unknown, KUrl(WP_POPUP_DIR));
@@ -119,7 +119,7 @@
 
 		if (tmpPerms != 0777) {
 
-			kDebug(14170) << "Perms not ok!";
+			kDebug() << "Perms not ok!";
 
 			int tmpYesNo =  KMessageBox::warningYesNo(Kopete::UI::Global::mainWidget(),
 													  i18n("Permissions of the working directory "
@@ -130,7 +130,7 @@
 			                                          QString::fromLatin1("Winpopup"), KGuiItem(i18n("Fix")), KGuiItem(i18n("Do Not Fix")));
 			if (tmpYesNo == KMessageBox::Yes) {
 				QStringList kdesuArgs = QStringList(QString("-c chmod 0777 " + WP_POPUP_DIR));
-				if (KToolInvocation::kdeinitExecWait("kdesu", kdesuArgs) == 0) return true;
+				if (KToolInvocation::kdeinitExecWait("kdesudo", kdesuArgs) == 0) return true;
 			}
 		} else {
 			return true;
@@ -154,6 +154,8 @@
 
 void WinPopupLib::startReadProcess(const QString &Host)
 {
+	kDebug() << "Getting info about" << Host << endl;
+
 	currentHosts.clear();
 	currentGroups.clear();
 	currentGroup.clear();
@@ -161,23 +163,28 @@
 	// for Samba 3
 	readGroupsProcess = new QProcess;
 	QStringList args;
-	args << "-N" << "-g" << "-L" << Host << "-";
+	args << "-N" << "-g" << "-L" << Host;
 
 	connect(readGroupsProcess, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(slotReadProcessExited(int, QProcess::ExitStatus)));
 
 	readGroupsProcess->setProcessChannelMode(QProcess::MergedChannels);
 	readGroupsProcess->start(smbClientBin, args);
+
+	kDebug() << "Starting smbclient" << smbClientBin << args << endl;
 }
 
 void WinPopupLib::slotReadProcessExited(int i, QProcess::ExitStatus status)
 {
 	if (i > 0 || status == QProcess::CrashExit) {
+		kDebug() << "smbclient crashed" << endl;
 		todo.removeAll(currentHost);
 		done += currentHost;
 	} else {
+		kDebug() << "smbclient exit successful" << endl;
 		QByteArray outputData = readGroupsProcess->readAll();
 		if (!outputData.isEmpty()) {
 			QString outputString = QString::fromUtf8(outputData.data());
+			kDebug() << "smbclient output:" << endl << outputString << endl;
 			QStringList outputList = outputString.split('\n');
 			QRegExp group("Workgroup\\|(.[^\\|]+)\\|(.+)"), host("Server\\|(.[^\\|]+)\\|(.+)"),
 					info("Domain=\\[([^\\]]+)\\] OS=\\[([^\\]]+)\\] Server=\\[([^\\]]+)\\]"),
@@ -187,15 +194,20 @@
 				if (host.indexIn(line) != -1) currentHosts += host.cap(1);
 				if (group.indexIn(line) != -1) currentGroups[group.cap(1)] = group.cap(2);
 			}
+		} else {
+			kDebug() << "smbclient output: (empty)" << endl;
 		}
 
 		delete readGroupsProcess;
 		readGroupsProcess = 0;
 
+		kDebug() << "Current Hosts:" << currentHosts << endl;
+
 		// Drop the first cycle - it's only the initial search host,
 		// the next round are the real masters. GF
 
 		if (passedInitialHost) {
+			kDebug() << "Passed Initial Host" << endl;
 
 			// move currentHost from todo to done
 			todo.removeAll(currentHost);
@@ -221,6 +233,7 @@
 			}
 
 		} else {
+			kDebug() << "Not Passed Initial Host" << endl;
 			passedInitialHost = true;
 			if (!currentGroups.isEmpty()) {
 				foreach (QString groupMaster, currentGroups) {
@@ -292,7 +305,7 @@
 				if (!messageFile.remove()) {
 					// QFile::remove() seems to be very persistent, it removes even files with 0444 owned by root
 					// if the directory permissions are 0777 - so this is just for safety. GF
-					kDebug(14170) << "Message file not removed - how that?";
+					kDebug() << "Message file not removed - how that?";
 					int tmpYesNo =  KMessageBox::warningYesNo(Kopete::UI::Global::mainWidget(),
 															  i18n("A message file could not be removed; "
 																   "maybe the permissions are incorrect.\n"
@@ -300,7 +313,7 @@
 					                                          QString::fromLatin1("Winpopup"), KGuiItem(i18n("Fix")), KGuiItem(i18n("Do Not Fix")));
 					if (tmpYesNo == KMessageBox::Yes) {
 						QStringList kdesuArgs = QStringList(QString("-c chmod 0666 " + tmpItem.url().path()));
-						if (KToolInvocation::kdeinitExecWait("kdesu", kdesuArgs) == 0) {
+						if (KToolInvocation::kdeinitExecWait("kdesudo", kdesuArgs) == 0) {
 							if (!messageFile.remove())
 								KMessageBox::error(Kopete::UI::Global::mainWidget(), i18n("Still cannot remove it; please fix it manually."));
 						}
@@ -309,7 +322,7 @@
 				if (!sender.isEmpty() && time.isValid())
 					emit signalNewMessage(text, time, sender);
 				else
-					kDebug(14170) << "Received invalid message!";
+					kDebug() << "Received invalid message!";
 			}
 		} // isFile
 	} // foreach
@@ -320,12 +333,14 @@
  */
 void WinPopupLib::sendMessage(const QString &Body, const QString &Destination)
 {
+	kDebug() << "Sending message" << Body.trimmed() << "to" << Destination << endl;
 	QProcess *sender = new QProcess(this);
 	QStringList args;
-	args << "-M" << Destination << "-N" << "-";
+	args << "-M" << Destination << "-N";
 	sender->start(smbClientBin, args);
 	sender->write(Body.trimmed().toLocal8Bit());
 	sender->closeWriteChannel();
+	kDebug() << "Staring smbclient" << smbClientBin << args << endl;
 }
 
 void WinPopupLib::settingsChanged(const QString &smbClient, int groupFreq)

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
kopete-devel mailing list
kopete-devel@kde.org
https://mail.kde.org/mailman/listinfo/kopete-devel

Reply via email to