From f888868f46a5418bac9ab528497136c152895305 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 12 May 1998 00:55:32 +0000 Subject: 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) --- source3/libsmb/namequery.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'source3/libsmb/namequery.c') diff --git a/source3/libsmb/namequery.c b/source3/libsmb/namequery.c index 4de10f10ce..7f3d012c30 100644 --- a/source3/libsmb/namequery.c +++ b/source3/libsmb/namequery.c @@ -51,15 +51,15 @@ static void _interpret_node_status(char *p, char *master,char *rname) type = CVAL(p,15); p += 16; - strcat(flags, (p[0] & 0x80) ? " " : " "); - if ((p[0] & 0x60) == 0x00) strcat(flags,"B "); - if ((p[0] & 0x60) == 0x20) strcat(flags,"P "); - if ((p[0] & 0x60) == 0x40) strcat(flags,"M "); - if ((p[0] & 0x60) == 0x60) strcat(flags,"H "); - if (p[0] & 0x10) strcat(flags," "); - if (p[0] & 0x08) strcat(flags," "); - if (p[0] & 0x04) strcat(flags," "); - if (p[0] & 0x02) strcat(flags," "); + fstrcat(flags, (p[0] & 0x80) ? " " : " "); + if ((p[0] & 0x60) == 0x00) fstrcat(flags,"B "); + if ((p[0] & 0x60) == 0x20) fstrcat(flags,"P "); + if ((p[0] & 0x60) == 0x40) fstrcat(flags,"M "); + if ((p[0] & 0x60) == 0x60) fstrcat(flags,"H "); + if (p[0] & 0x10) fstrcat(flags," "); + if (p[0] & 0x08) fstrcat(flags," "); + if (p[0] & 0x04) fstrcat(flags," "); + if (p[0] & 0x02) fstrcat(flags," "); if (master && !*master && type == 0x1d) { StrnCpy(master,qname,15); @@ -341,9 +341,9 @@ BOOL getlmhostsent( FILE *fp, char *name, int *name_type, struct in_addr *ipaddr if (*line == '#') continue; - strcpy(ip,""); - strcpy(name,""); - strcpy(flags,""); + pstrcpy(ip,""); + pstrcpy(name,""); + pstrcpy(flags,""); ptr = line; -- cgit