testsuite error on Solaris 2.6

Tom G. Christensen tgc at jupiterrise.com
Mon Apr 3 01:33:33 AEST 2017


On 02/04/17 15:43, Ingo Schwarze wrote:
> Tom G. Christensen wrote on Fri, Mar 31, 2017 at 09:30:10PM +0200:
>> I worked some more on this and comparing locales and their codesets
>> between Solaris 2.6 and 7 I'm reasonably sure that an empty codeset
>> value means ascii on Solaris 2.6.
>
> I'm not quite sure how relevant Solaris 2.6 still is, but i dimly
> remeber having seen systems where nl_langinfo(3) returns "" for
> ASCII before, though i have forgotten which ones.
>

I doubt Solaris 2.6 or 7 for that matter has any commercial relevance I 
just work on these old releases for hobbyist purposes.

I uploaded my OpenSSH 7.5p1 packages here:
https://jupiterrise.com/

>> So to ensure proper operation and get rid of the error in the testsuite
>> I've added "" as a valid alias for ascii in dangerous_locales().
>> With this change in place the testsuite runs with no errors.
>
> That would be the following patch.  I don't see any downside.
> A system where nl_codeset(3) would return "" for some non-ASCII
> and non-UTF-8 locale would probably cause you worse grief than
> sftp(1) or scp(1) potentially screwing up your terminal settings.
>

For reference this is the patch I made and included in my Solaris 2.6 
openssh packages:
https://github.com/tgc/tgcware-for-solaris/blob/master/openssh/src/0001-Treat-empty-codeset-value-as-ascii.patch

> OK?
>   Ingo
>
>
> Index: utf8.c
> ===================================================================
> RCS file: /cvs/src/usr.bin/ssh/utf8.c,v
> retrieving revision 1.5
> diff -u -p -r1.5 utf8.c
> --- utf8.c	19 Feb 2017 00:10:57 -0000	1.5
> +++ utf8.c	2 Apr 2017 13:35:38 -0000
> @@ -51,8 +51,8 @@ dangerous_locale(void) {
>  	char	*loc;
>
>  	loc = nl_langinfo(CODESET);
> -	return strcmp(loc, "US-ASCII") != 0 && strcmp(loc, "UTF-8") != 0 &&
> -	    strcmp(loc, "ANSI_X3.4-1968") != 0;
> +	return *loc != '\0' && strcmp(loc, "US-ASCII") != 0 &&
> +	    strcmp(loc, "UTF-8") != 0 && strcmp(loc, "ANSI_X3.4-1968") != 0;
>  }
>
>  static int
>

Note that in 7.5p1, '646' was added as an additional alias (which 
happened to cover not only NetBSD but also Solaris 7 and later.)

-tgc


More information about the openssh-unix-dev mailing list