Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 528452 - net-misc/x2goserver: invalid `echo -n` usage
Summary: net-misc/x2goserver: invalid `echo -n` usage
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo NX Server project
URL: http://bugs.x2go.org/cgi-bin/bugrepor...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-06 16:20 UTC by Lars Wendler (Polynomial-C) (RETIRED)
Modified: 2015-01-16 15:53 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2014-11-06 16:20:03 UTC
On dash before version 0.5.8.1-r2:

breakmygentoo:~ # qlist -CIve dash
app-shells/dash-0.5.8.1-r1
breakmygentoo:~ # x2gopath libexec
/usr/lib/x2go
breakmygentoo:~ # x2golistsessions
breakmygentoo:~ #


On =dash-0.5.8.1-r2:

breakmygentoo:~ # qlist -CIve dash
app-shells/dash-0.5.8.1-r2
breakmygentoo:~ # x2gopath libexec
-n /usr/lib/x2go

breakmygentoo:~ # x2golistsessions
Can't locate x2godbwrapper.pm in @INC (you may need to install the x2godbwrapper module) (@INC contains: -n /usr/lib/x2go
 /etc/perl /usr/local/lib64/perl5/5.20.1/x86_64-linux /usr/local/lib64/perl5/5.20.1 /usr/lib64/perl5/vendor_perl/5.20.1/x86_64-linux /usr/lib64/perl5/vendor_perl/5.20.1 /usr/local/lib64/perl5 /usr/lib64/perl5/vendor_perl /usr/lib64/perl5/5.20.1/x86_64-linux /usr/lib64/perl5/5.20.1 .) at /usr/bin/x2golistsessions line 28.
BEGIN failed--compilation aborted at /usr/bin/x2golistsessions line 28.
breakmygentoo:~ #


x2gopath is a shell script using "echo -n" to output the requested path. This is broken with =dash-0.5.8.1-r2 but works with older versions/revisions of dash.
As a result of x2gopath not working correctly many of the other scripts x2goserver uses break as well.
Comment 1 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2014-11-06 16:20:46 UTC
Oh, I forgot to mention that this only happens when /bin/sh points to dash.
Comment 2 SpanKY gentoo-dev 2014-11-07 00:51:56 UTC
x2goserver is broken.  you cannot rely on the -n option to echo.
Comment 3 Christian Ruppert (idl0r) gentoo-dev 2014-11-07 10:26:04 UTC
http://pubs.opengroup.org/onlinepubs/009604599/utilities/echo.html

"A string to be written to standard output. If the first operand is -n, or if any of the operands contain a backslash ( '\' ) character, the results are implementation-defined."

"On XSI-conformant systems, if the first operand is -n, it shall be treated as a string, not an option. The following character sequences shall be recognized on XSI-conformant systems within any of the arguments:"

"DASH
Description

DASH is a POSIX-compliant implementation of /bin/sh that aims to be as small as possible. It does this without sacrificing speed where possible. In fact, it is significantly faster than bash (the GNU Bourne-Again SHell) for most tasks."

So IMHO "-n" should be supported and work here as expected.
Comment 4 Christian Ruppert (idl0r) gentoo-dev 2014-11-07 10:29:41 UTC
(In reply to Christian Ruppert (idl0r) from comment #3)
> http://pubs.opengroup.org/onlinepubs/009604599/utilities/echo.html
> 
> "A string to be written to standard output. If the first operand is -n, or
> if any of the operands contain a backslash ( '\' ) character, the results
> are implementation-defined."
> 
> "On XSI-conformant systems, if the first operand is -n, it shall be treated
> as a string, not an option. The following character sequences shall be
> recognized on XSI-conformant systems within any of the arguments:"
> 
> "DASH
> Description
> 
> DASH is a POSIX-compliant implementation of /bin/sh that aims to be as small
> as possible. It does this without sacrificing speed where possible. In fact,
> it is significantly faster than bash (the GNU Bourne-Again SHell) for most
> tasks."
> 
> So IMHO "-n" should be supported and work here as expected.

Hm, or not.. "APPLICATION USAGE" seems to clarify that.
Comment 5 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2015-01-13 11:42:40 UTC
Upstream fixed this issue:

http://code.x2go.org/gitweb?p=x2goserver.git;a=patch;h=90bbbb6f9c21386c4d576e0f017c59a25aa7de9b
Comment 6 Bernard Cafarelli gentoo-dev 2015-01-16 15:53:36 UTC
Upstream seems busy with reorganization stuff, so I added the patch in x2goserver-4.0.1.18-r2!