diff options
author | Andrew Bartlett <abartlet@samba.org> | 2003-04-23 13:27:35 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2003-04-23 13:27:35 +0000 |
commit | 2a3a9f0bf43c3bf99a71f7296bb5ff6199893fea (patch) | |
tree | 44885a8b68275050bed851eca36937f19317eb3e /source3/smbd/service.c | |
parent | 13b54b9cfad9519f63f35fa284ce1c82b73d656a (diff) | |
download | samba-2a3a9f0bf43c3bf99a71f7296bb5ff6199893fea.tar.gz samba-2a3a9f0bf43c3bf99a71f7296bb5ff6199893fea.tar.bz2 samba-2a3a9f0bf43c3bf99a71f7296bb5ff6199893fea.zip |
Merge the 'safe' parts of my StrnCpy patch - many of the users really wanted
a pstrcpy/fstrcpy or at most a safe_strcpy().
These have the advantage of being compiler-verifiable.
Get these out of the way, along with a rewrite of 'get_short_archi' in the
spoolss client and server. (This pushes around const string pointers, rather
than copied strings).
Andrew Bartlett
(This used to be commit 32fb801ddc035e8971e9911ed4b6e51892e9d1cc)
Diffstat (limited to 'source3/smbd/service.c')
-rw-r--r-- | source3/smbd/service.c | 7 |
1 files changed, 4 insertions, 3 deletions
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)); |