From 994a4497032084cb744a644382e68cde464d19be Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 20 Sep 2001 10:26:50 +0000 Subject: We are not meant to touch the username, so use the pass->pw_name output rather than Get_Pwnam(user, True). (This used to be commit bf81f0021328da97afe58cc17317b15ec1b3cc96) --- source3/auth/auth_rhosts.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source3/auth/auth_rhosts.c') diff --git a/source3/auth/auth_rhosts.c b/source3/auth/auth_rhosts.c index 2492a2a68b..e319d8d5f8 100644 --- a/source3/auth/auth_rhosts.c +++ b/source3/auth/auth_rhosts.c @@ -29,7 +29,7 @@ extern int DEBUGLEVEL; allows this user from this machine. ****************************************************************************/ -static BOOL check_user_equiv(char *user, char *remote, char *equiv_file) +static BOOL check_user_equiv(const char *user, const char *remote, const char *equiv_file) { int plus_allowed = 1; char *file_host; @@ -134,11 +134,11 @@ static BOOL check_user_equiv(char *user, char *remote, char *equiv_file) /**************************************************************************** check for a possible hosts equiv or rhosts entry for the user ****************************************************************************/ -static BOOL check_hosts_equiv(char *user) +static BOOL check_hosts_equiv(char *user) /* should be const... */ { char *fname = NULL; pstring rhostsfile; - struct passwd *pass = Get_Pwnam(user,True); + struct passwd *pass = Get_Pwnam(user,False); if (!pass) return(False); @@ -147,16 +147,16 @@ static BOOL check_hosts_equiv(char *user) /* note: don't allow hosts.equiv on root */ if (fname && *fname && (pass->pw_uid != 0)) { - if (check_user_equiv(user,client_name(),fname)) + if (check_user_equiv(pass->pw_name,client_name(),fname)) return(True); } if (lp_use_rhosts()) { - char *home = get_user_home_dir(user); + char *home = pass->pw_dir; if (home) { slprintf(rhostsfile, sizeof(rhostsfile)-1, "%s/.rhosts", home); - if (check_user_equiv(user,client_name(),rhostsfile)) + if (check_user_equiv(pass->pw_name,client_name(),rhostsfile)) return(True); } } -- cgit