openbsd-ports/sysutils/cfengine/patches/patch-src_methods_c

57 lines
1.7 KiB
Plaintext
Raw Normal View History

$OpenBSD: patch-src_methods_c,v 1.2 2004/08/08 14:02:11 sturm Exp $
--- src/methods.c.orig Sat Jun 19 05:25:32 2004
+++ src/methods.c Mon Aug 2 15:45:48 2004
@@ -238,24 +238,24 @@ options[0] = '\0';
if (INFORM)
{
- strcat(options,"-I ");
+ (void)strlcat(options,"-I ",sizeof(options));
}
if (VERBOSE)
{
- strcat(options,"-v ");
+ (void)strlcat(options,"-v ",sizeof(options));
}
if (DEBUG || D2)
{
- strcat(options,"-d2 ");
+ (void)strlcat(options,"-d2 ",sizeof(options));
}
ptr = IsDefinedMethod(name,digeststring);
-strcat(options,"-Z ");
-strcat(options,digeststring);
-strcat(options," ");
+(void)strlcat(options,"-Z ",sizeof(options));
+(void)strlcat(options,digeststring,sizeof(options));
+(void)strlcat(options," ",sizeof(options));
snprintf(execstr,CF_BUFSIZE-1,"%s/bin/cfagent -f %s %s",WORKDIR,GetMethodFilename(ptr),options);
@@ -706,7 +706,7 @@ while (!feof(fp))
case cfmeth_sendclass:
Debug("Defining class: %s\n",arg);
- strncpy(METHODRETURNCLASSES,arg,CF_BUFSIZE-1);
+ strlcpy(METHODRETURNCLASSES,arg,sizeof(METHODRETURNCLASSES));
break;
case cfmeth_attacharg:
@@ -1012,10 +1012,10 @@ for (dirp = readdir(dirh); dirp != NULL;
SplitMethodName(dirp->d_name,client,server,name,digeststring,extra);
Debug("This request came from %s - our reply should be sent there!\n",client);
- strcpy(METHODREPLYTO,client);
+ (void)strlcpy(METHODREPLYTO,client,sizeof(METHODREPLYTO));
Debug("This request referred to us as %s - a plausible identity\n",client);
- strcpy(METHODFOR,server);
+ (void)strlcpy(METHODFOR,server,sizeof(METHODFOR));
if (strcmp(methodname,name) == 0)
{