Branch: Tag:

2013-09-27

2013-09-27 08:57:29 by Henrik Grubbström (Grubba) <grubba@grubba.org>

FSGC: Protect against some common misconfigurations.

We don't want to run an fsgc on the root or server directory,
and not one that zaps all files immediately either.

Fixes some more of [bug 6572 (#6572)].

428:   FSGarbWrapper register_fsgarb(string modid, string path, int max_age,    int|void max_size, int|void max_files)   { +  if ((path == "") || (path == "/") || (max_age <= 0)) return 0;    string id = modid + "\0" + path + "\0" + gethrtime();    FSGarb g = FSGarb(modid, path, max_age, max_size, max_files);    fsgarbs[id] = g;