bzr 1.0.0.candidate.3: ERROR: Permission denied: [Errno 13]

John Arbash Meinel john at arbash-meinel.com
Thu Dec 13 15:19:37 GMT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jari Aalto wrote:
> * Thu 2007-12-13 John Arbash Meinel <john at arbash-meinel.com>
> * Message-Id: 476141D5.6070503 at arbash-meinel.com
>>>>>     Committing to: /usr/src/build/build/ttcp/ttcp-20071212/CYGWIN-PATCHES/
>>>>>     bzr: ERROR: Permission denied: "df/0001makefilenewfile.-20071213000827-9zm28j15sb7x8kdi-1.knit": [Errno 13] Permission denied: '/usr/src/build/build/ttcp/ttcp-20071212/CYGWIN-PATCHES/.bzr/repository/knits/df/0001makefilenewfile.-20071213000827-9zm28j15sb7x8kdi-1.knit'
>>>> Can you run it again with -Derror flag, please? Or show relevant part
>>>> of .bzr.log. Probably it's related to
>>>> https://bugs.launchpad.net/bzr/+bug/139253
>>>>
>>>> I really like to know how to reproduce this error.
>>> I tested with the latest as well. This is native Cygwin on FAT32
>>> partition. Here is trace. Let me know how can I help more.
>>>
>>> Commands: "bzr init; bzd add" work, but not "ci" or "co".
>>>
>>> $ bzr --version
>>> Bazaar (bzr) 1.0.0.candidate.3
>>>   from bzr checkout /usr/lib/python2.5/site-packages/bzrlib
>>>     revision: 2
>>>     revid: jari.aalto at cante.net-20070401090549-bigooycypl8hej66
>>>     branch nick: bzrlib
>> ...
>>
>>>   File "local.py", line 351, in append_bytes
>>>   File "local.py", line 328, in _get_append_file
>>>   File "__init__.py", line 357, in _translate_error
>>> PermissionDenied: Permission denied: "df/0001makefilenewfile.-20071213000827-9zm28j15sb7x8kdi-1.knit": [Errno 13] Permission denied: '/usr/src/build/build/ttcp/ttcp-20071212/CYGWIN-PATCHES/.bzr/repository/knits/df/0001makefilenewfile.-20071213000827-9zm28j15sb7x8kdi-1.knit'
>> ^- Here it is just trying to open a file and write some data to it. (Most
>> likely this is going to be a new file).
>>
>> ...
>>
>>> -----------------------------------------------------------------------
>>> $ find .bzr/ -ls
>> ...
>>
>>> dr-xr-xr-x   2 root     None            0 Dec 13 02:08 .bzr/repository/knits/df
>> ^-- All of your directories are being created in readonly mode. Any idea why
>> that would be happening?
> 
> This is FAT32, where permissions do not apply like in NTFS. See this:
> 
>     $ umask; echo $CYGWIN
>     0022
>     server
> 
>     $ touch t.tmp; ls -la t.tmp
>     -rw-r--r-- 1 root None 0 Dec 13 16:38 t.tmp
> 
>     $ chmod 777 t.tmp; ls -la t.tmp
>     -rw-r--r-- 1 root None 0 Dec 13 16:38 t.tmp
> 
>     $ chmod ug-r t.tmp; ls -la t.tmp
>     -rw-r--r-- 1 root None 0 Dec 13 16:38 t.tmp
> 
> So all files are actually RW. How does python see the permissions? Could
> you have some python test file to try?

#! /usr/bin/env python
import os
from bzrlib import branch

b = branch.Branch.open('.')
print '%04o %04o' % (b.control_files._dir_mode, b.control_files._file_mode)

fname = 't.tmp'
st = os.stat(fname)
print '%04o' % (st.st_mode)


You might also try a patch like:
=== modified file 'bzrlib/lockable_files.py'
- --- bzrlib/lockable_files.py    2007-08-15 04:33:34 +0000
+++ bzrlib/lockable_files.py    2007-12-13 15:16:45 +0000
@@ -132,7 +132,9 @@
             self._dir_mode = 0755
             self._file_mode = 0644
         else:
- -            self._dir_mode = st.st_mode & 07777
+            # Always set user read-write
+            self._dir_mode = (st.st_mode & 07777) | 00600
+
             # Remove the sticky and execute bits for files
             self._file_mode = self._dir_mode & ~07111
         if not self._set_dir_mode:


Since it seems like when we check we get a readonly directory returned, which
is causing us to try and create the files in readonly mode (which doesn't work
so well).

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHYU2IJdeBCYSNAAMRAtoSAJ9U4Gq19U7yq34ubpfJVNWC1h05xgCg0SZW
yCieFwiV3CoOQ7IL56nQEhk=
=UXYG
-----END PGP SIGNATURE-----



More information about the bazaar mailing list