diff options
author | Jeremy Allison <jra@samba.org> | 1998-05-12 00:55:32 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 1998-05-12 00:55:32 +0000 |
commit | f888868f46a5418bac9ab528497136c152895305 (patch) | |
tree | cf72c864807b19e098a856aaec8daf334189ff84 /source3/utils/torture.c | |
parent | 9141acecdcebd9276107a500435e3d4545020056 (diff) | |
download | samba-f888868f46a5418bac9ab528497136c152895305.tar.gz samba-f888868f46a5418bac9ab528497136c152895305.tar.bz2 samba-f888868f46a5418bac9ab528497136c152895305.zip |
This is a security audit change of the main source.
It removed all ocurrences of the following functions :
sprintf
strcpy
strcat
The replacements are slprintf, safe_strcpy and safe_strcat.
It should not be possible to use code in Samba that uses
sprintf, strcpy or strcat, only the safe_equivalents.
Once Andrew has fixed the slprintf implementation then
this code will be moved back to the 1.9.18 code stream.
Jeremy.
(This used to be commit 2d774454005f0b54e5684cf618da7060594dfcbb)
Diffstat (limited to 'source3/utils/torture.c')
-rw-r--r-- | source3/utils/torture.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source3/utils/torture.c b/source3/utils/torture.c index ede801afe9..1abfee0541 100644 --- a/source3/utils/torture.c +++ b/source3/utils/torture.c @@ -134,7 +134,7 @@ static BOOL rw_torture(struct cli_state *c, int numops) if (i % 10 == 0) { printf("%d\r", i); fflush(stdout); } - sprintf(fname,"\\torture.%u", n); + slprintf(fname, sizeof(fstring) - 1, "\\torture.%u", n); if (!wait_lock(c, fnum2, n*sizeof(int), sizeof(int))) { return False; @@ -860,7 +860,7 @@ static void create_procs(int nprocs, int numops) get_myname(myname,NULL); if (*username == 0 && getenv("LOGNAME")) { - strcpy(username,getenv("LOGNAME")); + pstrcpy(username,getenv("LOGNAME")); } argc--; @@ -888,11 +888,11 @@ static void create_procs(int nprocs, int numops) fstrcpy(myname, optarg); break; case 'U': - strcpy(username,optarg); + pstrcpy(username,optarg); p = strchr(username,'%'); if (p) { *p = 0; - strcpy(password, p+1); + pstrcpy(password, p+1); gotpass = 1; } break; @@ -906,7 +906,7 @@ static void create_procs(int nprocs, int numops) while (!gotpass) { p = getpass("Password:"); if (p) { - strcpy(password, p); + pstrcpy(password, p); gotpass = 1; } } |