mirror of https://github.com/djcb/mu.git
index: limit length of maildir path to MaxTermLength
This limit was already in place, but now we detect it a bit earlier (in the indexer). We _could_ increase it (by using hashes for dirstamps), but right now it's a good catch for circular symlinks.
This commit is contained in:
parent
f3c303106d
commit
885903c496
|
@ -141,6 +141,15 @@ Indexer::Private::handler(const std::string& fullpath, struct stat* statbuf,
|
||||||
switch (htype) {
|
switch (htype) {
|
||||||
case Scanner::HandleType::EnterDir:
|
case Scanner::HandleType::EnterDir:
|
||||||
case Scanner::HandleType::EnterNewCur: {
|
case Scanner::HandleType::EnterNewCur: {
|
||||||
|
if (fullpath.length() > MaxTermLength) {
|
||||||
|
// currently the db uses the path as a key, and
|
||||||
|
// therefore it cannot be too long. We'd get an error
|
||||||
|
// later anyway but for now it's useful for surviving
|
||||||
|
// circular symlinks
|
||||||
|
mu_warning("'{}' is too long; ignore", fullpath);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// in lazy-mode, we ignore this dir if its dirstamp suggest it
|
// in lazy-mode, we ignore this dir if its dirstamp suggest it
|
||||||
// is up-to-date (this is _not_ always true; hence we call it
|
// is up-to-date (this is _not_ always true; hence we call it
|
||||||
// lazy-mode); only for actual message dirs, since the dir
|
// lazy-mode); only for actual message dirs, since the dir
|
||||||
|
|
Loading…
Reference in New Issue