Skip to content

Commit

Permalink
auth: Disable auth caching for passwd-file
Browse files Browse the repository at this point in the history
Its caching is usually unnecessary, because the passwd-files are efficiently
in memory already. It's also problematic, because extra_fields can contain
%variables, which can be lookup-dependent. So for example if %{lport} is used
in extra_fields, it would need to be included in the cache key. But because
different variables can be used by different users' extra_fields, there's
really no good way to include all of it in the cache key.
  • Loading branch information
sirainen committed Mar 29, 2016
1 parent 3e25053 commit e052c22
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
8 changes: 0 additions & 8 deletions src/auth/passdb-passwd-file.c
Expand Up @@ -150,14 +150,6 @@ passwd_file_preinit(pool_t pool, const char *args)
module->pwf = db_passwd_file_init(args, FALSE,
global_auth_settings->debug);
module->username_format = format;

if (!module->pwf->vars)
module->module.default_cache_key = format;
else {
module->module.default_cache_key = auth_cache_parse_key(pool,
t_strconcat(format, module->pwf->path, NULL));
}

module->module.default_pass_scheme = scheme;
return &module->module;
}
Expand Down
12 changes: 0 additions & 12 deletions src/auth/userdb-passwd-file.c
Expand Up @@ -13,8 +13,6 @@
#include <unistd.h>
#include <fcntl.h>

#define PASSWD_FILE_CACHE_KEY "%u"

struct passwd_file_userdb_iterate_context {
struct userdb_iterate_context ctx;
struct istream *input;
Expand Down Expand Up @@ -191,16 +189,6 @@ passwd_file_preinit(pool_t pool, const char *args)
module->pwf = db_passwd_file_init(args, TRUE,
global_auth_settings->debug);
module->username_format = format;

if (!module->pwf->vars)
module->module.default_cache_key = PASSWD_FILE_CACHE_KEY;
else {
module->module.default_cache_key =
auth_cache_parse_key(pool,
t_strconcat(PASSWD_FILE_CACHE_KEY,
module->pwf->path,
NULL));
}
return &module->module;
}

Expand Down

0 comments on commit e052c22

Please sign in to comment.