"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/plugins/last-login/last-login-plugin.c" between
dovecot-2.3.16.tar.gz and dovecot-2.3.17.tar.gz

About: Dovecot is an IMAP and POP3 server, written with security primarily in mind.

last-login-plugin.c  (dovecot-2.3.16):last-login-plugin.c  (dovecot-2.3.17)
skipping to change at line 97 skipping to change at line 97
if (user->session_restored) { if (user->session_restored) {
/* This is IMAP unhibernation, not a real login. */ /* This is IMAP unhibernation, not a real login. */
return; return;
} }
dict_value = mail_user_plugin_getenv(user, "last_login_dict"); dict_value = mail_user_plugin_getenv(user, "last_login_dict");
if (dict_value == NULL || dict_value[0] == '\0') if (dict_value == NULL || dict_value[0] == '\0')
return; return;
i_zero(&set); i_zero(&set);
set.username = user->username;
set.base_dir = user->set->base_dir; set.base_dir = user->set->base_dir;
set.event_parent = user->event; set.event_parent = user->event;
if (mail_user_get_home(user, &set.home_dir) <= 0)
set.home_dir = NULL;
if (dict_init(dict_value, &set, &dict, &error) < 0) { if (dict_init(dict_value, &set, &dict, &error) < 0) {
i_error("last_login_dict: dict_init(%s) failed: %s", i_error("last_login_dict: dict_init(%s) failed: %s",
dict_value, error); dict_value, error);
return; return;
} }
luser = p_new(user->pool, struct last_login_user, 1); luser = p_new(user->pool, struct last_login_user, 1);
luser->module_ctx.super = *v; luser->module_ctx.super = *v;
user->vlast = &luser->module_ctx.super; user->vlast = &luser->module_ctx.super;
v->deinit = last_login_user_deinit; v->deinit = last_login_user_deinit;
skipping to change at line 125 skipping to change at line 122
key_name = mail_user_plugin_getenv(user, "last_login_key"); key_name = mail_user_plugin_getenv(user, "last_login_key");
if (key_name == NULL) { if (key_name == NULL) {
key_name = t_strdup_printf(LAST_LOGIN_DEFAULT_KEY_PREFIX"%s", key_name = t_strdup_printf(LAST_LOGIN_DEFAULT_KEY_PREFIX"%s",
user->username); user->username);
} }
key_name = t_strconcat(DICT_PATH_SHARED, key_name, NULL); key_name = t_strconcat(DICT_PATH_SHARED, key_name, NULL);
precision = mail_user_plugin_getenv(user, "last_login_precision"); precision = mail_user_plugin_getenv(user, "last_login_precision");
trans = dict_transaction_begin(dict); const struct dict_op_settings *dset = mail_user_get_dict_op_settings(user
);
trans = dict_transaction_begin(dict, dset);
if (precision == NULL || strcmp(precision, "s") == 0) if (precision == NULL || strcmp(precision, "s") == 0)
dict_set(trans, key_name, dec2str(ioloop_time)); dict_set(trans, key_name, dec2str(ioloop_time));
else if (strcmp(precision, "ms") == 0) { else if (strcmp(precision, "ms") == 0) {
dict_set(trans, key_name, t_strdup_printf( dict_set(trans, key_name, t_strdup_printf(
"%ld%03u", (long)ioloop_timeval.tv_sec, "%ld%03u", (long)ioloop_timeval.tv_sec,
(unsigned int)(ioloop_timeval.tv_usec/1000))); (unsigned int)(ioloop_timeval.tv_usec/1000)));
} else if (strcmp(precision, "us") == 0) { } else if (strcmp(precision, "us") == 0) {
dict_set(trans, key_name, t_strdup_printf( dict_set(trans, key_name, t_strdup_printf(
"%ld%06u", (long)ioloop_timeval.tv_sec, "%ld%06u", (long)ioloop_timeval.tv_sec,
(unsigned int)ioloop_timeval.tv_usec)); (unsigned int)ioloop_timeval.tv_usec));
 End of changes. 3 change blocks. 
4 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)