SFTP server should only treat ~<user>/<foo> as existing if <foo> is '+junk' or a project name

Bug #111419 reported by Jonathan Lange
6
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Medium
Jonathan Lange

Bug Description

At the moment, the SFTP server treats "~jml/.git/" as an existing directory. This can cause problems for Bazaar plugins, and is not actually correct.

Tags: lp-code
Revision history for this message
Jonathan Lange (jml) wrote :

Consult lifeless for severity information.

Changed in launchpad-bazaar:
importance: Undecided → High
status: Unconfirmed → Confirmed
Revision history for this message
James Henstridge (jamesh) wrote :

The current behaviour was designed to allow users to do an initial push of a branch with just "bzr push" (instead of "bzr push --create-prefix") even if they had never created branches for the product.

To check whether a product exists, an XMLRPC call is required. Unfortunately the twisted vfs layer isn't deferred-safe, so doing the lookup when traversing /~USER/PRODUCT was not really possible. However, conch seems to handle a deferred as a result of an mkdir (which we were previously taking advantage of). The phantom product directories allowed us to put off the XMLRPC until the mkdir for the branch directory, which is why things are done as they are. So unless twisted has been fixed since then, this will be difficult to change.

You said that this can cause problems for plugins. What problems does it actually cause?

Revision history for this message
James Henstridge (jamesh) wrote :

From conversations on IRC, we could solve the problem at hand by by checking if the product name is a valid Launchpad name before returning a placeholder. This would be enough so that /~USER/.git and /~USER/.bzr don't exist. The user would still see placeholders for non-existent products if they passed a valid Launchpad name though.

Tim Penhey (thumper)
Changed in launchpad-bazaar:
assignee: nobody → jml
Revision history for this message
Tim Penhey (thumper) wrote :

Jono, was this fixed as part of the roll out of 1.1.7?

Revision history for this message
Jonathan Lange (jml) wrote :

Not sure if this was fixed, not sure what the actual problem is.

Changed in launchpad-bazaar:
status: Confirmed → Incomplete
Revision history for this message
David Allouche (ddaa) wrote :

The problem is failing early when trying to access a branch that does not exist.

In the initially reported problem, I guess that a user was trying to access /~user, bzr-git looked for control files found that .git was an existing directory, and failed with an obscure error later.

I guess that an easier fix for "do not present phantom control directories at the product level" would be to treat all directory names that are valid (existing or not) product names or +junk as existing, and everything else (including names starting by a dot) as not existing.

Maybe the "valid product name" constraint would need updating to actually be consistent with that.

Revision history for this message
Tim Penhey (thumper) wrote :

Not really high.

Changed in launchpad-bazaar:
importance: High → Medium
Revision history for this message
Jonathan Lange (jml) wrote :

The real problem here is that having the git plugin installed breaks your ability to use LP (to some extent). Didn't get this fixed in 1.1.9, and would like to hold off from assigning it to a milestone.

Changed in launchpad-bazaar:
status: Incomplete → Confirmed
Revision history for this message
Tim Penhey (thumper) wrote :

Is this fixed?

Revision history for this message
Jonathan Lange (jml) wrote : Re: [Bug 111419] Re: SFTP server should only treat ~<user>/<foo> as existing if <foo> is '+junk' or a project name

On Tue, Apr 8, 2008 at 2:32 PM, Tim Penhey <email address hidden> wrote:
> Is this fixed?
>

Nope:

$ python
Python 2.5.2 (r252:60911, Mar 12 2008, 13:36:25)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from bzrlib.transport import get_transport
>>> t = get_transport('sftp://bazaar.launchpad.net/~jml')
>>> t.has('.git')
True

Revision history for this message
Jonathan Lange (jml) wrote :

This is fixed. Not sure when.

$ python
Python 2.5.2 (r252:60911, Oct 5 2008, 19:29:17)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from bzrlib.transport import get_transport
>>> t = get_transport('sftp://bazaar.launchpad.net/~jml')
>>> t.has('.git')
False
>>>

Changed in launchpad-bazaar:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.