Bug 444466

Summary: scp remote completion removes hostname
Product: [Fedora] Fedora Reporter: Matthew Miller <mattdm>
Component: gvfsAssignee: Tomáš Bžatek <tbzatek>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 10CC: alexl, dan, davidz, einars, jeff, long, matt, mclasen, quiffman, redhat2, tim, tmz, tsmetana, ville.skytta, yaneti
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 1.0.3-10.fc10 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-06-16 01:41:44 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Patch against gvfs F-10 branch to fix this and #466883
none
Patch against gvfs F-10 branch to fix this and #466883 (take 2) none

Description Matthew Miller 2008-04-28 15:15:59 UTC
I'm using a ssh key, so tab completion should magically work with remote files
with scp. But when I type something like 

scp remotehost:/home/mattdm/p[tab]

it gets remapped to

scp /home/mattdm/public_html/

without the remote hostname and : (regardless of whether public_html exists on
the local system). It's clearly getting the path right, but for some reason, the
hostname gets eaten.

This is with bash-completion-20060301-10.noarch, and I'm fairly certain that
this wasn't a problem a year or so ago, so I'm not sure exactly what change
caused this to happen.

Comment 1 Ville Skyttä 2008-04-28 16:27:01 UTC
I use commands like that all the time and they work for me fine on F-8, also
with 20060301-10 (I have no F-9/Rawhide box to test with at the moment).  Could
you post the console output of:

$ set -x
$ scp remotehost:/home/mattdm/p[TAB]

?

Comment 2 Matthew Miller 2008-04-28 17:10:36 UTC
Sure.

There's some conflicts with 'p[tab]' so this is with 'pub[tab]'....

$ scp remotehost:/home/mattdm/pub+ local cur userhost path
+ local 'IFS=
'
+ COMPREPLY=()
+ cur=remotehost:/home/mattdm/pub
+ _expand
+ '[' remotehost:/home/mattdm/pub '!=' remotehost:/home/mattdm/pub ']'
+ [[ remotehost:/home/mattdm/pub == \~*/* ]]
+ [[ remotehost:/home/mattdm/pub == \~* ]]
+ [[ remotehost:/home/mattdm/pub == *:* ]]
+ cur=remotehost:/home/mattdm/pub
+ userhost=remotehost
+ path=/home/mattdm/pub
+ path=/home/mattdm/pub
+ '[' -z /home/mattdm/pub ']'
+ COMPREPLY=($( ssh -o 'Batchmode yes' $userhost                              
command ls -aF1d "$path*" 2>/dev/null |                         s
++ sed -e 's/[][(){}<>",:;^&!$&=?`|\ ]/\\\\\\&/g' -e 's/'\''/\\\\\\&/g' -e
's/[*@|=]$//g' -e 's/[^\/]$/& /g'
++ ssh -o 'Batchmode yes' remotehost command ls -aF1d '/home/mattdm/pub*'
+ return 0
              /home/mattdm/public_html/



Comment 3 Yanko Kaneti 2008-05-04 22:41:15 UTC
This is broken by the completion gvfs installs.

Comment 4 Ville Skyttä 2008-05-05 17:59:18 UTC
Thanks for the info, reassigning.

Comment 5 Ville Skyttä 2008-05-05 18:00:50 UTC
*** Bug 444469 has been marked as a duplicate of this bug. ***

Comment 6 Matthew Miller 2008-05-05 18:08:42 UTC
Yes, confirming that removing gvfs solves the problem.

Comment 7 Bug Zapper 2008-05-14 10:18:36 UTC
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 8 Ville Skyttä 2008-05-23 12:54:26 UTC
Bumping priority/severity, the breakage is affecting quite a few people.

Comment 9 Ville Skyttä 2008-05-23 12:54:51 UTC
*** Bug 448054 has been marked as a duplicate of this bug. ***

Comment 10 Ville Skyttä 2008-05-29 05:20:16 UTC
*** Bug 448781 has been marked as a duplicate of this bug. ***

Comment 11 Richard Guest 2008-06-18 03:09:18 UTC
+1 for broken and *really* annoying...

Using gvfs-0.2.3-11.fc9 and bash-completion-20060301-10.noarch

Is there a fix in the pipeline?

Comment 12 Dan Siemon 2008-06-28 20:49:04 UTC
For a quick fix that doesn't involve removing gvfs just add a line containing
"return" to the top of /etc/profile.d/gvfs-bash-completion.sh.

Comment 13 Ville Skyttä 2008-11-13 19:51:23 UTC
Any news on this one?

Comment 14 Todd Zullinger 2008-12-12 23:55:59 UTC
It definitely seems that gvfs should be escaping ":" locally if it needs this, rather than forcing all other bash completion consumers to work around this.  I know upstream git folks dealt with it.¹

Is there a bug (Fedora or upstream) that details just why gvfs needs to strip
":" and any reasons why it can't do so in a more local way?  (And I don't mean the bash FAQ that's listed in the gvfs completion script. :)

I'd also be tempted to consider installing the gvfs bash completion via
/etc/profile.d instead of /etc/bash_completion.d a bug.  If the ":" hack was
removed or done locally, there wouldn't be any need for the completion script
to live in /etc/profile.d.

¹ See http://repo.or.cz/w/git.git?a=commitdiff;h=db8a9ff03831a26aa8bfad8bb026b90739d684ec for the work-around that they had to apply.

Comment 15 Todd Zullinger 2008-12-21 17:17:31 UTC
Can the gvfs maintainers point out exactly what gvfs usage breaks when COMP_WORDBREAKS contains a ":"?  Is it only command line usage that is affected?  And if so, are there more gvfs command line users than there are users of the various other bash completion types that are broken by gvfs' global adjustment of COMP_WORDBREAKS?

If we knew what was broken for gvfs, perhaps someone could propose a patch that didn't break other bash completion uses.

Comment 16 Matthias Clasen 2009-01-06 16:35:29 UTC
Should probably CC davidz, how did the bash completion support and cares about this...

Comment 17 David Zeuthen 2009-01-06 17:31:34 UTC
Yeah, this is a bug in GVfs. I'm not sure how to really fix it; suggestions welcome in the upstream bug for this

http://bugzilla.gnome.org/show_bug.cgi?id=523732

Comment 18 Todd Zullinger 2009-03-15 21:25:14 UTC
Yay, Alex L fixed this upstream.  Can we cherry-pick the simple change and get it into some updated packages for F-9/F-10?  I'll attach such a patch for F-10.  If that's agreeable, I'd be happy to do the same for F-9 and get things queued up so when the next gvfs update is ready we can fix this annoyance.  (As a bonus, I also fixed #466883 too.)

Comment 19 Todd Zullinger 2009-03-15 21:27:16 UTC
Created attachment 335278 [details]
Patch against gvfs F-10 branch to fix this and #466883

Comment 20 Ville Skyttä 2009-03-15 21:44:23 UTC
Hmm, I don't see anything related to COMP_WORDBREAKS in the patch, just a removal of a check whether the shell is bash or not.  Did I miss something?

Comment 21 Todd Zullinger 2009-03-15 23:29:15 UTC
Created attachment 335281 [details]
Patch against gvfs F-10 branch to fix this and #466883 (take 2)

Gah, sorry Ville.  I managed to attach an incomplete patch.  Let's try this again...

Comment 22 Bug Zapper 2009-06-10 00:29:38 UTC
This message is a reminder that Fedora 9 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 9.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '9'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 9's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 9 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 23 Todd Zullinger 2009-06-10 03:25:28 UTC
This is still a problem in F-10.  I'd be happy to update and apply the patch I attached in comment #21 and coordinate an update with Tomas.  If that's agreeable, I'll ask for commit privs in the pkgdb.

Comment 24 Fedora Update System 2009-06-12 14:51:15 UTC
gvfs-1.0.3-10.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/gvfs-1.0.3-10.fc10

Comment 25 Fedora Update System 2009-06-16 01:41:31 UTC
gvfs-1.0.3-10.fc10 has been pushed to the Fedora 10 stable repository.  If problems still persist, please make note of it in this bug report.