When doing a "force user" we need to remember what the "sanitized_username"
was from the original connect.
return status;
}
+ /* We don't want to replace the original sanitized_username
+ as it is the original user given in the connect attempt.
+ This is used in '%U' substitutions. */
+ TALLOC_FREE(forced_serverinfo->sanitized_username);
+ forced_serverinfo->sanitized_username =
+ talloc_move(forced_serverinfo,
+ &conn->session_info->sanitized_username);
+
TALLOC_FREE(conn->session_info);
conn->session_info = forced_serverinfo;