Description of problem: Trying to connect to a krfb VNC session through a web browser hangs forever. This is because /usr/bin/krfb_httpd has some literal ^M characters converted into actual newlines. Looking at /usr/bin/krfb_httpd on older releases with vim (or any editor that will show special control characters) will show (including line numbers): 9 url="${url/^M/}" 10 httptype="${httptype/^M/}" .... 16 line="${line/^M/}" Fedora 8's /usr/bin/krfb_httpd shows this instead: 9 url="${url/ 10 /}" 11 httptype="${httptype/ 12 /}" .... 18 line="${line/ 19 /}" As you can see, the literal ^M chars have been turned into newlines. Unfortunately, diff seems to get confused by literal ^M chars so the output is garbage. Version-Release number of selected component (if applicable): kdenetwork-3.5.8-9.fc8 How reproducible: Every time Steps to Reproduce: 1. Share your desktop with krfb 2. Connect to http://yourmachine:5800/ with a web browser on another machine Actual results: Web browser doesn't do anything Expected results: Java VNC viewer should launch Additional info: The <APPLET> tag is also wrong. It should be: <APPLET CODE=vncviewer/VNCViewer.class ARCHIVE=vncviewer.jar ...> I'll open a new BZ on this problem.
See https://bugzilla.redhat.com/show_bug.cgi?id=433511#c4 for the fixed script.
> "Looking at /usr/bin/krfb_httpd on older releases" I assume you mean kdenetwork <= 3.5.7 here?
I should have been more specific: I was actually looking at RHEL 4.6's /usr/bin/krfb_httpd which is kdenetwork-3.3.1-2.3 The script actually hasn't changed all that much, though. The only other difference is 'head -1' to 'head -n 1' in line 23: size=`xdpyinfo .... |head -n 1|....`
the Mac-style line breaks caused an problem and it's changed to unix line breaks. http://bugs.kde.org/135013 Are you sure that you won't see the problem with he Mac-style line breaks?
The problem in http://bugs.kde.org/135013 is that the *entire script* is using CRs (Mac-style). If you open the RHEL 5.1 krfb_httpd script in vim, the script is one long line, and vim notes [noeol] at the bottom. ~~~~~~~~~~~~~~~~~~~~ #! /usr/bin/env bash^M^Mif [ "$1" = "--kinetd" ]; then^M # redirect stdin and stdout to the inetd socket.^M exec <&$2 >&$2^Mfi^M^Mread request url httptype || exit 0^Murl="${url/^M/}"^Mhttptype="${httptype/^M/}"^M^M...... ~~~~~~~~~~~~~~~~~~~~ In Fedora 8, the script was converted back to LFs (Unix-style), but it went a little too far. There were 3 CRs that should have remained literal CRs (see original description). Using the stock krfb_httpd program, when I try to connect to http://server:5800/ with Firefox, the icon in the upper right spins forever and the status bar says "Waiting for server...". If I change the 3 lines to use literal ^M chars, then it launches the Java VNC viewer.
Since 'diff' gets confused by the literal ^M chars, I've taken 3 screenshots of vim to demonstrate the problem. 1. krfb_httpd-rhel51.png RHEL 5.1 kdenetwork-3.5.4-4.fc6 /usr/bin/krfb_httpd This is the problem described in http://bugs.kde.org/135013 -- the entire script is using Mac style CRs. (See bug 433529 about this problem.) 2. krfb_httpd-f8.png Fedora 8 kdenetwork-3.5.8-9.fc8 /usr/bin/krfb_httpd This shows how the Mac-style CRs were converted to Unix-style LFs, but it went too far and converted 3 that should have remained CRs. Annotated with Gimp to show where the CRs should be. 3. krfb_httpd-f8-fixed.png I've restored the three literal CRs and now krfb_httpd works as expected.
Created attachment 295660 [details] RHEL 5.1 krfb_httpd
Created attachment 295661 [details] Fedora 8 krfb_httpd
Created attachment 295662 [details] fixed Fedora 8 krfb_httpd
Yuck, a file which automatically gets corrupted by the KatePart's line ending conversion (which is presumably how it got broken in the first place), fun... Thanks for tracking this down. I'm forwarding this to the upstream bug report.
I think I see why the script is written this way: http requests end in a DOS-style <CR><LF>. The web browser sends a request like GET /index.html HTTP/1.1<CR><LF> See http://www.faqs.org/rfcs/rfc2616.html section "5.1 Request-Line". Since krfb_httpd is a Unix bash script, it reads a line and gets GET /index.html HTTP/1.1<CR> as a value. It uses a bash parameter expansion feature to strip the <CR> from the text: url="${url/^M/}" That searches for ^M and replaces it with nothing (since there's nothing between / and }). After KatePart or whatever mangled the script, it became url="${url/ /}" which means it's no longer stripping the <CR> and it gets confused. krfb_httpd really should be written in Perl or Python with a module that speaks http properly...
Fixed in 3.5.9-2
As per http://fedoraproject.org/wiki/BugZappers/BugStatusWorkFlow , the bug should be in MODIFIED state, not RESOLVED, as long as the update has not been pushed.
kdegames-3.5.9-1.fc7, kdesdk-3.5.9-1.fc7, kdeutils-3.5.9-1.fc7, kdeaccessibility-3.5.9-1.fc7, arts-1.5.9-1.fc7, kdeaddons-3.5.9-1.fc7, kdeartwork-3.5.9-1.fc7, kdebindings-3.5.9-1.fc7, kdegraphics-3.5.9-1.fc7, kdewebdev-3.5.9-1.fc7, kde-i18n-3.5.9-4.fc7, kdeadmin-3.5.9-1.fc7, kdeedu-3.5.9-1.fc7, kdemultimedia-3.5.9-1.fc7, kdenetwork-3.5.9-2.fc7, kdetoys-3.5.9-1.fc7, kdelibs-3.5.9-3.fc7, kdebase-3.5.9-1.fc7, kdepim-3.5.9-6.fc7, kdevelop-3.5.1-1.fc7 has been pushed to the Fedora 7 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update kdegames kdesdk kdeutils kdeaccessibility arts kdeaddons kdeartwork kdebindings kdegraphics kdewebdev kde-i18n kdeadmin kdeedu kdemultimedia kdenetwork kdetoys kdelibs kdebase kdepim kdevelop'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F7/FEDORA-2008-1892
kdevelop-3.5.1-3.fc7, arts-1.5.9-1.fc7, kdelibs-3.5.9-3.fc7, kdeaccessibility-3.5.9-1.fc7, kdeaddons-3.5.9-1.fc7, kdeadmin-3.5.9-1.fc7, kdeartwork-3.5.9-1.fc7, kdebase-3.5.9-3.fc7, kdebindings-3.5.9-1.fc7, kdeedu-3.5.9-1.fc7, kdegames-3.5.9-1.fc7, kdegraphics-3.5.9-1.fc7, kdemultimedia-3.5.9-1.fc7, kdepim-3.5.9-6.fc7, kdetoys-3.5.9-1.fc7, kdewebdev-3.5.9-1.fc7, kde-i18n-3.5.9-4.fc7, kdenetwork-3.5.9-2.fc7, kdesdk-3.5.9-1.fc7, kdeutils-3.5.9-1.fc7 has been pushed to the Fedora 7 stable repository. If problems still persist, please make note of it in this bug report.
kdevelop-3.5.1-3.fc8, arts-1.5.9-1.fc8, kdelibs-3.5.9-3.fc8, kdeaccessibility-3.5.9-1.fc8, kdeaddons-3.5.9-1.fc8, kdeadmin-3.5.9-1.fc8, kdeartwork-3.5.9-1.fc8, kdebase-3.5.9-3.fc8, kdebindings-3.5.9-1.fc8, kdeedu-3.5.9-1.fc8, kdegames-3.5.9-1.fc8, kdegraphics-3.5.9-1.fc8, kde-i18n-3.5.9-4.fc8, kdemultimedia-3.5.9-1.fc8, kdenetwork-3.5.9-2.fc8, kdepim-3.5.9-6.fc8, kdesdk-3.5.9-1.fc8, kdetoys-3.5.9-1.fc8, kdeutils-3.5.9-1.fc8, kdewebdev-3.5.9-1.fc8 has been pushed to the Fedora 8 stable repository. If problems still persist, please make note of it in this bug report.