summaryrefslogtreecommitdiffstats
path: root/opensuse/tdelibs/fix-kerberos-printing.diff
blob: 0276cdd06f9a5807f74d5ba104aee58c3a76350f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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);
 		}
 	}