This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours

Bug 841771

Summary: sftp completion hook breaks on file name with multi-byte
Product: [Fedora] Fedora Reporter: Kamil Dudka <kdudka>
Component: opensshAssignee: Petr Lautrbach <plautrba>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 19CC: czochanski, dtucker, hego.one, jeff, kdudka, loganjerry, mattias.ellert, mgrepl, plautrba, rustyBSD, scorpy_sk, tmraz
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openssh-6.2p2-4.fc19 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 840598 Environment:
Last Closed: 2013-07-27 21:08:49 EDT Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Attachments:
Description Flags
File: backtrace none

Description Kamil Dudka 2012-07-20 04:43:00 EDT
+++ This bug was initially created as a clone of Bug #840598 +++

Hi,
I was in my banana tree when I noticed a segfault with sftp on Fedora 17.
It segfaults with autocompletion of a local accentued folder/(file?).

Steps to Reproduce:
$ mkdir Modèles
$ sftp root@localhost
sftp> put Mo [press TAB]
And it segfaults.
  
Actual results:
SEGFAULT

Expected results:
'put Modèles'

Max

--- Additional comment from kdudka on 2012-07-18 13:29:11 CEST ---

This fixes the SIGSEGV in libedit:

diff --git a/src/chared.c b/src/chared.c
index 0a95913..1b6fa68 100644
--- a/src/chared.c
+++ b/src/chared.c
@@ -612,7 +612,7 @@ FUN(el,insertstr)(EditLine *el, const Char *s)
 {
    size_t len;

-   if ((len = Strlen(s)) == 0)
+   if (s == NULL || (len = Strlen(s)) == 0)
        return -1;
    if (el->el_line.lastchar + len >= el->el_line.limit) {
        if (!ch_enlargebufs(el, len))

However, if you want sftp to actually support UTF-8, you need to fix sftp so that complete_match() does not call el_insertstr() with incomplete multibyte sequences.
Comment 1 Petr Lautrbach 2012-11-26 10:04:48 EST
*** Bug 862282 has been marked as a duplicate of this bug. ***
Comment 2 czochanski 2012-11-28 15:46:28 EST
Error on pressing <tab> in sftp while the name of the file has a utf-8 character in it.

backtrace_rating: 4
Package: openssh-clients-5.9p1-27.fc17
OS Release: Fedora release 17 (Beefy Miracle)
Comment 3 czochanski 2012-11-28 15:46:32 EST
Created attachment 653751 [details]
File: backtrace
Comment 4 Darren Tucker 2013-06-01 18:52:49 EDT
Upstream bug (now with patch): https://bugzilla.mindrot.org/show_bug.cgi?id=1990
Comment 5 Fedora Update System 2013-06-20 04:58:21 EDT
openssh-6.1p1-9.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/openssh-6.1p1-9.fc18
Comment 6 Fedora Update System 2013-06-20 06:03:19 EDT
openssh-5.9p1-30.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/openssh-5.9p1-30.fc17
Comment 7 Fedora Update System 2013-06-20 21:59:43 EDT
Package openssh-5.9p1-30.fc17:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing openssh-5.9p1-30.fc17'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-11392/openssh-5.9p1-30.fc17
then log in and leave karma (feedback).
Comment 8 Fedora Update System 2013-06-26 21:59:11 EDT
openssh-6.1p1-9.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 9 Fedora Update System 2013-06-30 21:41:30 EDT
openssh-5.9p1-30.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 10 Štefan Gurský 2013-07-06 23:43:18 EDT
I experience this (or very similar) bug in Fedora 19.

After doing steps to reproduce from first post (using same name Modèles), after pressing Tab, this is the last line in terminal before bash prompt appears:

sftp> put Moel_insertstr failed

and then terminal is in state where it does not echo any input.

Name        : openssh
Version     : 6.2p2
Release     : 3.fc19
Comment 11 Kamil Dudka 2013-07-08 07:35:28 EDT
I can see the patch already pushed to the f19 branch, but there is no build of openssh that includes the patch.  The last build is checked out from 66608a1d whereas the patch was introduced in 2ee68109.  This needs to be built for f19.
Comment 12 Fedora Update System 2013-07-23 10:39:25 EDT
openssh-6.2p2-4.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/openssh-6.2p2-4.fc19
Comment 13 Fedora Update System 2013-07-23 23:23:12 EDT
Package openssh-6.2p2-4.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing openssh-6.2p2-4.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-13457/openssh-6.2p2-4.fc19
then log in and leave karma (feedback).
Comment 14 Fedora Update System 2013-07-27 21:08:49 EDT
openssh-6.2p2-4.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.