Bug 136649

Summary: 64bit specific bug in KDEPrintd::processRequest()
Product: [Applications] kdeprint Reporter: Modestas Vainius <modax>
Component: generalAssignee: KDEPrint Devel Mailinglist <kde-print-devel>
Status: CLOSED FIXED    
Severity: normal CC: jlayt
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: The patch for the bug

Description Modestas Vainius 2006-11-01 16:13:45 UTC
Version:            (using KDE KDE 3.5.5)
Installed from:    Debian testing/unstable Packages
Compiler:          gcc 4.1.1 
OS:                Linux

Attempting with to Print Server->Configure Server usually fails with the following error message:

Unable to configure print server. Error message received from manager:
Unable to retrieve configuration file from the CUPS server. You probably don't have the access permissions to perform this operation.

Then ~/.xsession-errors gets a warning:

---
Cannot communicate with kded_kpasswdserver
----

As it later turned out, actual KIO::AuthInfo queryAuthInfo(KIO::AuthInfo,QString,long int,long int) never gets called because KPasswdServer::process(const QCString &fun, const QByteArray &data, QCString& replyType, QByteArray &replyData) fails due to insufficient arguments at:

arg >> arg2;
if (arg.atEnd()) return false; // arg.atEnd() returns true though there is still an argument (arg3) pending

The reason for this is due to incorrect notation of long int constant and assumtion that sizeof(int) == sizeof(long int) which is wrong on 64bit architectures. The attached patch fixes the problem.
Comment 1 Modestas Vainius 2006-11-01 16:15:02 UTC
Created attachment 18351 [details]
The patch for the bug
Comment 2 Cristian Tibirna 2006-11-02 02:15:03 UTC
SVN commit 601090 by tibirna:

Patch for 64bits incompatibility, thanks go to Modestas Vainius.
BUG:136649


 M  +1 -1      kdeprintd.cpp  


--- branches/KDE/3.5/kdelibs/kdeprint/kdeprintd.cpp #601089:601090
@@ -263,7 +263,7 @@
 	info.comment = i18n( "Printing system" );
 
 	QDataStream input( params, IO_WriteOnly );
-	input << info << i18n( "Authentication failed (user name=%1)" ).arg( info.username ) << 0 << req->seqNbr;
+	input << info << i18n( "Authentication failed (user name=%1)" ).arg( info.username ) << 0L << (long int) req->seqNbr;
 	if ( callingDcopClient()->call( "kded", "kpasswdserver", "queryAuthInfo(KIO::AuthInfo,QString,long int,long int)",
 				params, replyType, reply ) )
 	{
Comment 3 John Layt 2008-12-31 20:29:22 UTC
Closing old Resolved status bug.