Wrong mode of .bzr files when pushed via FTP

Bug #259855 reported by René 'Necoro' Neumann
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Medium
John A Meinel

Bug Description

After pushing a local branch to my webspace using FTP, I cannot branch from there using HTTP. This is because all changed files get the mode 0600 - thus disallowing the HTTP server to access these files.

> bzr pull
Using saved location: http://something
bzr: ERROR: Transport error: Server refuses to fulfill the request (403 Forbidden) for http://something/.bzr/repository/pack-names

Fixing the modes makes it work :)

Related branches

Revision history for this message
Vincent Ladeuil (vila) wrote :

On IRC jam provides the following patch which fixed the problem.

Changed in bzr:
assignee: nobody → vila
status: New → Confirmed
Revision history for this message
John A Meinel (jameinel) wrote :

The basic issue is that FTPTransport.stat() returns a value rather than raising TransportNotPossible. So we trust the returned mode. However, it always returns 0000 as the file/directory permissions.

Our code then translates this into 0700 (because we do (mode & 07777) | 0700, so that directories and files are always writable by the current user.)

My workaround detects when the transport doesn't return proper bits for the directory (assuming that mode = 0000 is *never* valid). And then just reverts to not trying to chmod new files. Which seems like a reasonable workaround.

It would be nicer if FTPTransport.stat() returned the mode bits for the directory, but it might be difficult for the ftp protocol.

John A Meinel (jameinel)
Changed in bzr:
assignee: vila → jameinel
status: Confirmed → Fix Committed
John A Meinel (jameinel)
Changed in bzr:
importance: Undecided → Medium
milestone: none → 1.7
Revision history for this message
pdf23ds (pdf23ds) wrote :

I got exactly the same problem, except that the initial URL was /branch-format. Running version 1.8rc1

John A Meinel (jameinel)
Changed in bzr:
status: Fix Committed → 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.