This can be used as alt-username to kick users by the hash.
array_pop_front(&dir->pending_requests);
T_BEGIN {
- request->callback(NULL, NULL, errormsg, request->context);
+ request->callback(NULL, NULL, 0, errormsg,
+ request->context);
} T_END;
director_request_free(request);
}
if (!director_get_username_hash(dir, username,
&username_hash)) {
- callback(NULL, NULL, "Failed to expand director_username_hash", context);
+ callback(NULL, NULL, 0,
+ "Failed to expand director_username_hash", context);
return;
}
director_update_user(dir, dir->self_host, user);
T_BEGIN {
request->callback(user->host, user->host->hostname,
+ request->username_hash,
NULL, request->context);
} T_END;
director_request_free(request);
typedef void
director_request_callback(const struct mail_host *host, const char *hostname,
- const char *errormsg, void *context);
+ unsigned int username_hash, const char *errormsg,
+ void *context);
void director_request(struct director *dir, const char *username,
const char *tag,
#define DIRECTOR_VERSION_MAJOR 1
#define DIRECTOR_VERSION_MINOR 9
+#define DIRECTOR_ALT_USER_FIELD_NAME "user_director_hash"
+
/* weak users supported in protocol */
#define DIRECTOR_VERSION_WEAK_USERS 1
/* director ring remove supported */
static void
login_host_callback(const struct mail_host *host, const char *hostname,
- const char *errormsg, void *context)
+ unsigned int username_hash, const char *errormsg,
+ void *context)
{
struct login_host_request *request = context;
struct director *dir = request->conn->dir;
str_append(str, "\thostip=");
str_append(str, host->ip_str);
}
+ str_printfa(str, "\t"DIRECTOR_ALT_USER_FIELD_NAME"=%u",
+ username_hash);
line = str_c(str);
}
login_connection_send_line(request->conn, line);