problem (and patch) on read only .aar files #19

Closed
gernotschilling opened this Issue May 3, 2011 · 2 comments

Comments

Projects
None yet
2 participants
@gernotschilling

hi!

i installed some .aar files in /var/spool/aarddict/ with owner nobody and world readable.

aarddict would not read them and give a "permission denied" error.

the problem is in the init function in the Volume class, file dictionary.py, line 416 ( on my version ):

   f = open(self.file_name, 'r+b')

the 'r+b' opens the file in "update mode", which means read and write.
is the program ever writing to the aar files?

after a change to

   f = open(self.file_name, 'rb')

the files are loading without problems and all logged-in users (for now only me...) can use the program without any problems and without wasting lots of space.

@itkach

This comment has been minimized.

Show comment
Hide comment
@itkach

itkach May 5, 2011

Member

Indeed, 'r+b' mode prevents opening dictionaries from any read-only file system - bad. I remember having trouble with 'rb' - mmap.mmap() for some reason didn't like the file opened in 'rb' mode and was failing on one of the platforms (Windows?) and open(self.file_name, 'r+b') worked everywhere, so that's how it went... Anyway, 'rb' is the correct mode to use, I'll do more testing on different platforms and put it in. Thank you.

Member

itkach commented May 5, 2011

Indeed, 'r+b' mode prevents opening dictionaries from any read-only file system - bad. I remember having trouble with 'rb' - mmap.mmap() for some reason didn't like the file opened in 'rb' mode and was failing on one of the platforms (Windows?) and open(self.file_name, 'r+b') worked everywhere, so that's how it went... Anyway, 'rb' is the correct mode to use, I'll do more testing on different platforms and put it in. Thank you.

@ghost ghost assigned itkach May 5, 2011

@itkach

This comment has been minimized.

Show comment
Hide comment
@itkach

itkach May 5, 2011

Member

Fixed in a0a0861

Member

itkach commented May 5, 2011

Fixed in a0a0861

@itkach itkach closed this May 5, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment