Cache filenames are (still) too long for ecryptfs

Bug #545197 reported by Brad Crittenden
24
This bug affects 3 people
Affects Status Importance Assigned to Milestone
lazr.restfulclient
Fix Released
Undecided
Unassigned

Bug Description

ecryptfs has a ~150 character file path limit. The file paths generated can be much longer than that causing an exception when saving to the cache.

In lazr.restfulclient the 'safename' method was replicated and changed to limit the length to 149 characters. Unfortunately httplib2 later prepends the cachedir name to the truncated key. The cachedir can easily be more than 50 characters and pushes the file path to well beyond the limits.

Here is a traceback:
http://paste.ubuntu.com/400029/

Brad Crittenden (bac)
summary: - Cache file paths are too long for encryptfs
+ Cache file paths are too long for ecryptfs
Revision history for this message
Leonard Richardson (leonardr) wrote : Re: Cache file paths are too long for ecryptfs

This is the revenge of bug 512832.

Revision history for this message
Leonard Richardson (leonardr) wrote :

I spoke with Dustin Kirkland about this. We confirmed that there are filenames shorter than 150 characters that get encrypted to over 256 characters. Just as an example, the letter 'a' repeated 144 times cannot be used as an ecryptfs filename.

I'm going to reduce the limit to 143 and (more importantly) make it a hackable property of one of the launchpadlib classes, so if this happens again, the end-user will have a workaround.

summary: - Cache file paths are too long for ecryptfs
+ Cache filenames are (still) too long for ecryptfs
Revision history for this message
Leonard Richardson (leonardr) wrote :

FYI, the path name is irrelevant. Linux does impose a maximum path name but it's more like 4096 characters. Even with each path component being encrypted, to run afoul of the limit you'd have to put your cache directory sixteen levels deep, with each directory name being 143 characters long.

Changed in lazr.restfulclient:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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