model: Limit filenames to 120 characters for eCryptFS (bug 1898)

This commit is contained in:
Thomas Perl 2015-07-01 23:17:39 +02:00
parent c71391552a
commit cc6ea467bb

View file

@ -133,7 +133,12 @@ class PodcastModelObject(object):
class PodcastEpisode(PodcastModelObject):
"""holds data for one object in a channel"""
MAX_FILENAME_LENGTH = 200
# In theory, Linux can have 255 bytes (not characters!) in a filename, but
# filesystems like eCryptFS store metadata in the filename, making the
# effective number of characters less than that. eCryptFS recommends
# 140 chars, we use 120 here (140 - len(extension) - len(".partial")).
# References: gPodder bug 1898, http://unix.stackexchange.com/a/32834
MAX_FILENAME_LENGTH = 120
__slots__ = schema.EpisodeColumns