summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2003-04-21 11:45:46 +0000
committerAndrew Bartlett <abartlet@samba.org>2003-04-21 11:45:46 +0000
commit61922ee4363bd090bafd7a9ea7e6b2f2b3709e87 (patch)
tree37ee77b3b9401e54c261f422e5ab930de474f2c1 /source3/smbd
parentcd8b806f1c2004dfaebb9da32664e06b92d7e24c (diff)
downloadsamba-61922ee4363bd090bafd7a9ea7e6b2f2b3709e87.tar.gz
samba-61922ee4363bd090bafd7a9ea7e6b2f2b3709e87.tar.bz2
samba-61922ee4363bd090bafd7a9ea7e6b2f2b3709e87.zip
Use fstrcpy/pstrcpy when that's what we really mean...
Andrew Bartlett (This used to be commit e8aa615591dc44de4de85322d455a47b3122b9eb)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/password.c6
-rw-r--r--source3/smbd/service.c7
2 files changed, 7 insertions, 6 deletions
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));