summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/auth/auth_rhosts.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source3/auth/auth_rhosts.c b/source3/auth/auth_rhosts.c
index d8e1b01942..8915acaecd 100644
--- a/source3/auth/auth_rhosts.c
+++ b/source3/auth/auth_rhosts.c
@@ -199,6 +199,8 @@ static NTSTATUS check_rhosts_security(const struct auth_context *auth_context,
{
NTSTATUS nt_status = NT_STATUS_LOGON_FAILURE;
SAM_ACCOUNT *account = NULL;
+ pstring rhostsfile;
+ const char *home;
if (!NT_STATUS_IS_OK(nt_status =
auth_get_sam_account(user_info->internal_username.str,
@@ -206,9 +208,8 @@ static NTSTATUS check_rhosts_security(const struct auth_context *auth_context,
return nt_status;
}
- pstring rhostsfile;
-
- char *home = pdb_get_unix_homedir(account);
+ home = pdb_get_unix_homedir(account);
+
if (home) {
slprintf(rhostsfile, sizeof(rhostsfile)-1, "%s/.rhosts", home);
become_root();