This structure element was only written to, not read.
It is filled into the companion structure, auth_session_info()
by create_local_token().
Andrew Bartlett
Signed-off-by: Andrew Tridgell <tridge@samba.org>
}
result->unix_name = talloc_strdup(result, unix_username);
- result->sanitized_username = sanitize_username(result, unix_username);
- if ((result->unix_name == NULL)
- || (result->sanitized_username == NULL)) {
+ if (result->unix_name == NULL) {
TALLOC_FREE(result);
return NT_STATUS_NO_MEMORY;
}
return NULL;
}
- dst->sanitized_username = talloc_strdup(dst, src->unix_info->sanitized_username);
- if (!dst->sanitized_username) {
- TALLOC_FREE(dst);
- return NULL;
- }
-
return dst;
}
result->unix_name = talloc_strdup(result, found_username);
- result->sanitized_username = sanitize_username(result,
- result->unix_name);
- if (result->sanitized_username == NULL) {
- TALLOC_FREE(result);
- return NT_STATUS_NO_MEMORY;
- }
-
/* copy in the info3 */
result->info3 = i3 = copy_netr_SamInfo3(result, info3);
if (result->info3 == NULL) {
TALLOC_FREE(pwd);
- result->sanitized_username = sanitize_username(result,
- result->unix_name);
- if (result->sanitized_username == NULL) {
- TALLOC_FREE(result);
- return NT_STATUS_NO_MEMORY;
- }
-
if (IS_DC && is_our_machine_account(username)) {
/*
* This is a hack of monstrous proportions.
bool nss_token;
char *unix_name;
-
- /*
- * For performance reasons we keep an alpha_strcpy-sanitized version
- * of the username around as long as the global variable current_user
- * still exists. If we did not do keep this, we'd have to call
- * alpha_strcpy whenever we do a become_user(), potentially on every
- * smb request. See set_current_user_info.
- */
- char *sanitized_username;
};
struct auth_context {
int max_len);
char *escape_shell_string(const char *src);
char **str_list_make_v3(TALLOC_CTX *mem_ctx, const char *string, const char *sep);
-char *sanitize_username(TALLOC_CTX *mem_ctx, const char *username);
/* The following definitions come from lib/version.c */
TALLOC_FREE(s);
return list;
}
-
-char *sanitize_username(TALLOC_CTX *mem_ctx, const char *username)
-{
- fstring tmp;
-
- alpha_strcpy(tmp, username, ". _-$", sizeof(tmp));
- return talloc_strdup(mem_ctx, tmp);
-}