Gentoo Archives: gentoo-commits

From: "Michael Palimaka (kensington)" <kensington@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in kde-base/krdc/files: krdc-4.13.1-freerdp.patch
Date: Thu, 22 May 2014 16:07:53
Message-Id: 20140522160749.4476D2004E@flycatcher.gentoo.org
1 kensington 14/05/22 16:07:49
2
3 Added: krdc-4.13.1-freerdp.patch
4 Log:
5 Add patch from upstream to support >=net-misc/freerdp-1.1.0 wrt bug #511010.
6
7 (Portage version: 2.2.8-r1/cvs/Linux x86_64, signed Manifest commit with key 0x06B1F38DCA45A1EC!)
8
9 Revision Changes Path
10 1.1 kde-base/krdc/files/krdc-4.13.1-freerdp.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/kde-base/krdc/files/krdc-4.13.1-freerdp.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/kde-base/krdc/files/krdc-4.13.1-freerdp.patch?rev=1.1&content-type=text/plain
14
15 Index: krdc-4.13.1-freerdp.patch
16 ===================================================================
17 Support >=free-rdp-1.1.0.
18
19 https://git.reviewboard.kde.org/r/115059/
20
21 diff --git a/rdp/rdpview.cpp b/rdp/rdpview.cpp
22 index 0d14e04691549e084b58501cd10ca2382ef25c63..9062ba5fa060284a679f0c9bc211ab7dd6972c0a 100644
23 --- a/rdp/rdpview.cpp
24 +++ b/rdp/rdpview.cpp
25 @@ -158,71 +158,58 @@ bool RdpView::start()
26 width = this->parentWidget()->size().width();
27 height = this->parentWidget()->size().height();
28 }
29 - arguments << "-g" << QString::number(width) + 'x' + QString::number(height);
30 + arguments << "-decorations"; // put this option first so we can detect xfreerdp < 1.1
31 + arguments << "/w:" + QString::number(width);
32 + arguments << "/h:" + QString::number(height);
33
34 - arguments << "-k" << keymapToXfreerdp(m_hostPreferences->keyboardLayout());
35 + arguments << "/kbd:" + keymapToXfreerdp(m_hostPreferences->keyboardLayout());
36
37 if (!m_url.userName().isEmpty()) {
38 // if username contains a domain, it needs to be set with another parameter
39 if (m_url.userName().contains('\\')) {
40 const QStringList splittedName = m_url.userName().split('\\');
41 - arguments << "-d" << splittedName.at(0);
42 - arguments << "-u" << splittedName.at(1);
43 + arguments << "/d:" + splittedName.at(0);
44 + arguments << "/u:" + splittedName.at(1);
45 } else {
46 - arguments << "-u" << m_url.userName();
47 + arguments << "/u:" + m_url.userName();
48 }
49 } else {
50 - arguments << "-u" << "";
51 + arguments << "-u:";
52 }
53
54 - if (!m_url.password().isNull())
55 - arguments << "-p" << m_url.password();
56 -
57 - arguments << "-D"; // request the window has no decorations
58 - arguments << "-X" << QString::number(m_container->winId());
59 - arguments << "-a" << QString::number((m_hostPreferences->colorDepth() + 1) * 8);
60 -
61 - switch (m_hostPreferences->sound()) {
62 - case 1:
63 - arguments << "-o";
64 - break;
65 - case 0:
66 - arguments << "--plugin" << "rdpsnd";
67 - break;
68 - case 2:
69 - default:
70 - break;
71 - }
72 + arguments << "/parent-window:" + QString::number(m_container->winId());
73 + arguments << "/bpp:" + QString::number((m_hostPreferences->colorDepth() + 1) * 8);
74 + arguments << "/audio-mode:" + m_hostPreferences->sound();
75
76 if (!m_hostPreferences->shareMedia().isEmpty()) {
77 QStringList shareMedia;
78 - shareMedia << "--plugin" << "rdpdr" << "--data" << "disk:media:" + m_hostPreferences->shareMedia() << "--";
79 + shareMedia << "/drive:media," + m_hostPreferences->shareMedia();
80 arguments += shareMedia;
81 }
82
83 QString performance;
84 switch (m_hostPreferences->performance()) {
85 case 0:
86 - performance = 'm';
87 + performance = "modem";
88 break;
89 case 1:
90 - performance = 'b';
91 + performance = "broadband";
92 break;
93 case 2:
94 - performance = 'l';
95 + performance = "lan";
96 break;
97 default:
98 break;
99 }
100
101 - arguments << "-x" << performance;
102 + arguments << "/network:" + performance;
103
104 if (m_hostPreferences->console()) {
105 - arguments << "-0";
106 + arguments << "/admin";
107 }
108
109 if (m_hostPreferences->remoteFX()) {
110 - arguments << "--rfx";
111 + arguments << "/rfx";
112 }
113
114 if (!m_hostPreferences->extraOptions().isEmpty()) {
115 @@ -233,16 +220,21 @@ bool RdpView::start()
116 // krdc has no support for certificate management yet; it would not be possbile to connect to any host:
117 // "The host key for example.com has changed" ...
118 // "Add correct host key in ~/.freerdp/known_hosts to get rid of this message."
119 - arguments << "--ignore-certificate";
120 + arguments << "/cert-ignore";
121
122 // clipboard sharing is activated in KRDC; user can disable it at runtime
123 - arguments << "--plugin" << "cliprdr";
124 + arguments << "/clipboard";
125
126 - arguments << "-t" << QString::number(m_port);
127 - arguments << m_host;
128 + arguments << "/port:" + QString::number(m_port);
129 + arguments << "/v:" + m_host;
130
131 kDebug(5012) << "Starting xfreerdp with arguments:" << arguments;
132
133 + //avoid printing the password in debug
134 + if (!m_url.password().isNull()) {
135 + arguments << "/p:" + m_url.password();
136 + }
137 +
138 setStatus(Connecting);
139
140 connect(m_process, SIGNAL(error(QProcess::ProcessError)), SLOT(processError(QProcess::ProcessError)));
141 @@ -302,7 +294,7 @@ void RdpView::connectionError()
142
143 void RdpView::processError(QProcess::ProcessError error)
144 {
145 - kDebug(5012) << "processError:" << error;
146 + kDebug(5012) << error;
147 if (m_quitFlag) // do not try to show error messages while quitting (prevent crashes)
148 return;
149
150 @@ -319,33 +311,13 @@ void RdpView::processError(QProcess::ProcessError error)
151 void RdpView::receivedStandardError()
152 {
153 const QString output(m_process->readAllStandardError());
154 - kDebug(5012) << "receivedStandardError:" << output;
155 - QString line;
156 - int i = 0;
157 - while (!(line = output.section('\n', i, i)).isEmpty()) {
158 -
159 - // the following error is issued by freerdp because of a bug in freerdp 1.0.1 and below;
160 - // see: https://github.com/FreeRDP/FreeRDP/pull/576
161 - //"X Error of failed request: BadWindow (invalid Window parameter)
162 - // Major opcode of failed request: 7 (X_ReparentWindow)
163 - // Resource id in failed request: 0x71303348
164 - // Serial number of failed request: 36
165 - // Current serial number in output stream: 36"
166 - if (line.contains(QLatin1String("X_ReparentWindow"))) {
167 - KMessageBox::error(0, i18n("The version of \"xfreerdp\" you are using is too old.\n"
168 - "xfreerdp 1.0.2 or greater is required."),
169 - i18n("RDP Failure"));
170 - connectionError();
171 - return;
172 - }
173 - i++;
174 - }
175 + kDebug(5012) << output;
176 }
177
178 void RdpView::receivedStandardOutput()
179 {
180 const QString output(m_process->readAllStandardOutput());
181 - kDebug(5012) << "receivedStandardOutput:" << output;
182 + kDebug(5012) << output;
183 QString line;
184 int i = 0;
185 while (!(line = output.section('\n', i, i)).isEmpty()) {
186 @@ -373,6 +345,14 @@ void RdpView::receivedStandardOutput()
187 return;
188 }
189
190 + // we no longer support freerdp < 1.1, we only support versions with the new interface
191 + if (line.contains(QLatin1String("invalid option: -decorations"))) {
192 + KMessageBox::error(0, i18n("The version of \"xfreerdp\" you are using is too old.\n"
193 + "xfreerdp 1.1 or greater is required."),
194 + i18n("RDP Failure"));
195 + connectionError();
196 + return;
197 + }
198 i++;
199 }
200 }