LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File fix-kerberos-printing.diff of Package kdelibs3 (Project KDE:KDE3)

Index: kdeprint/management/smbview.cpp
===================================================================
--- kdeprint/management/smbview.cpp.orig
+++ kdeprint/management/smbview.cpp
@@ -187,13 +187,26 @@ void SmbView::setOpen(QListViewItem *ite
 		}
 		else if (item->depth() == 1)
 		{ // opening server
+			char *krb5ccname = getenv ("KRB5CCNAME");
 			m_current = item;
-			*m_proc << "smbclient -N -L ";
-                        *m_proc << KProcess::quote(item->text(0));
-                        *m_proc << " -W ";
-                        *m_proc << KProcess::quote(item->parent()->text(0));
-			*m_proc << " -A ";
-                        *m_proc << KProcess::quote(m_passwdFile->name());
+			if (krb5ccname)
+			{
+				*m_proc << "smbclient -k -N -L ";
+			}
+			else
+			{
+				*m_proc << "smbclient -N -L ";
+			}
+			*m_proc << KProcess::quote (item->text (0));
+			*m_proc << " -W ";
+			*m_proc << KProcess::quote (item->parent ()->
+							text (0));
+			if (!krb5ccname)
+			{
+				*m_proc << " -A ";
+				*m_proc << KProcess::
+					quote (m_passwdFile->name ());
+			}
 			startProcess(ShareListing);
 		}
 	}