[Bug 1632] [PATCH] UTF-8 hint sftp-server extension

bugzilla-daemon at bugzilla.mindrot.org bugzilla-daemon at bugzilla.mindrot.org
Mon Jan 11 22:06:44 EST 2010


https://bugzilla.mindrot.org/show_bug.cgi?id=1632

--- Comment #17 from Damien Miller <djm at mindrot.org> 2010-01-11 22:06:42 EST ---
(From update of attachment 1773)
I'm still not sure about this diff, but some comments:

>diff --git a/sftp-server.8 b/sftp-server.8
>index 27b67ed..f8d1ff1 100644
>--- a/sftp-server.8
>+++ b/sftp-server.8
>@@ -30,10 +30,11 @@
> .Nd SFTP server subsystem
> .Sh SYNOPSIS
> .Nm sftp-server
>-.Op Fl eh
>+.Op Fl ehS
> .Op Fl f Ar log_facility
> .Op Fl l Ar log_level
> .Op Fl u Ar umask
>+.Op Fl s Ar filename_charset

If we do this, I'd rather not use more option letters than necessary.
Perhaps disable it with "-s none"?

>diff --git a/sftp-server.c b/sftp-server.c
>index 27e80f0..27984df 100644
>--- a/sftp-server.c
>+++ b/sftp-server.c
> typedef struct Stat Stat;
>@@ -523,6 +530,19 @@ process_init(void)
> 	/* fstatvfs extension */
> 	buffer_put_cstring(&msg, "fstatvfs at openssh.com");
> 	buffer_put_cstring(&msg, "2"); /* version */
>+	/* filename charset extension */ 
>+	if (!disable_filename_charset_ext) {
>+		if (!filename_charset) {
>+			setlocale(LC_CTYPE, "");

Wouldn't the user locale be better use than the system locale? Each
user may be using their own filename encoding...

>+			filename_charset = nl_langinfo(CODESET);
>+			setlocale(LC_CTYPE, "C");

Wouldn't it be better to restore the original locale?

>+			if ((strcmp(filename_charset, "646") == 0) ||
>+			    (strcmp(filename_charset, "ANSI_X3.4-1968") == 0))
>+				filename_charset = "ISO-8859-1";

How are these heuristics determined? Are there other aliases that we
need to be aware of?

-- 
Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
You are watching someone on the CC list of the bug.


More information about the openssh-bugs mailing list