From 61922ee4363bd090bafd7a9ea7e6b2f2b3709e87 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 21 Apr 2003 11:45:46 +0000 Subject: Use fstrcpy/pstrcpy when that's what we really mean... Andrew Bartlett (This used to be commit e8aa615591dc44de4de85322d455a47b3122b9eb) --- source3/smbd/password.c | 6 +++--- source3/smbd/service.c | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'source3/smbd') diff --git a/source3/smbd/password.c b/source3/smbd/password.c index 784c1525c8..175c1ec3a9 100644 --- a/source3/smbd/password.c +++ b/source3/smbd/password.c @@ -249,7 +249,7 @@ void add_session_user(const char *user) if (!(passwd = Get_Pwnam(user))) return; - StrnCpy(suser,passwd->pw_name,sizeof(suser)-1); + fstrcpy(suser,passwd->pw_name); if (suser && *suser && !in_list(suser,session_users,False)) { @@ -447,7 +447,7 @@ and given password ok\n", user)); if (!ok && lp_username(snum)) { char *auser; pstring user_list; - StrnCpy(user_list,lp_username(snum),sizeof(pstring)); + pstrcpy(user_list,lp_username(snum)); pstring_sub(user_list,"%S",lp_servicename(snum)); @@ -477,7 +477,7 @@ and given password ok (%s)\n", user)); /* check for a normal guest connection */ if (!ok && GUEST_OK(snum)) { fstring guestname; - StrnCpy(guestname,lp_guestaccount(),sizeof(guestname)-1); + fstrcpy(guestname,lp_guestaccount()); if (Get_Pwnam(guestname)) { fstrcpy(user,guestname); ok = True; diff --git a/source3/smbd/service.c b/source3/smbd/service.c index 18a92bc82f..cfb5e0e414 100644 --- a/source3/smbd/service.c +++ b/source3/smbd/service.c @@ -486,13 +486,14 @@ static connection_struct *make_connection_snum(int snum, user_struct *vuser, pstring tmp_gname; BOOL user_must_be_member = False; - StrnCpy(tmp_gname,lp_force_group(snum),sizeof(pstring)-1); + pstrcpy(tmp_gname,lp_force_group(snum)); if (tmp_gname[0] == '+') { user_must_be_member = True; - StrnCpy(gname,&tmp_gname[1],sizeof(pstring)-2); + /* even now, tmp_gname is null terminated */ + pstrcpy(gname,&tmp_gname[1]); } else { - StrnCpy(gname,tmp_gname,sizeof(pstring)-1); + pstrcpy(gname,tmp_gname); } /* default service may be a group name */ pstring_sub(gname,"%S",lp_servicename(snum)); -- cgit