summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2001-09-20 10:26:50 +0000
committerAndrew Bartlett <abartlet@samba.org>2001-09-20 10:26:50 +0000
commit994a4497032084cb744a644382e68cde464d19be (patch)
treeee31377ae1bb7751fe9b335e4953c91f9b7fd5c7
parent5377944635137126913370e88be0399bf4a254d0 (diff)
downloadsamba-994a4497032084cb744a644382e68cde464d19be.tar.gz
samba-994a4497032084cb744a644382e68cde464d19be.tar.bz2
samba-994a4497032084cb744a644382e68cde464d19be.zip
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)
-rw-r--r--source3/auth/auth_rhosts.c12
-rw-r--r--source3/smbd/auth_rhosts.c12
2 files changed, 12 insertions, 12 deletions
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);
}
}
diff --git a/source3/smbd/auth_rhosts.c b/source3/smbd/auth_rhosts.c
index 2492a2a68b..e319d8d5f8 100644
--- a/source3/smbd/auth_rhosts.c
+++ b/source3/smbd/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);
}
}