2004-08-08 10:02:11 -04:00
|
|
|
$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
|
2004-06-17 07:21:42 -04:00
|
|
|
@@ -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);
|
|
|
|
|
2004-08-08 10:02:11 -04:00
|
|
|
@@ -706,7 +706,7 @@ while (!feof(fp))
|
2004-06-17 07:21:42 -04:00
|
|
|
|
|
|
|
case cfmeth_sendclass:
|
|
|
|
Debug("Defining class: %s\n",arg);
|
|
|
|
- strncpy(METHODRETURNCLASSES,arg,CF_BUFSIZE-1);
|
|
|
|
+ strlcpy(METHODRETURNCLASSES,arg,sizeof(METHODRETURNCLASSES));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case cfmeth_attacharg:
|
2004-08-08 10:02:11 -04:00
|
|
|
@@ -1012,10 +1012,10 @@ for (dirp = readdir(dirh); dirp != NULL;
|
2004-06-17 07:21:42 -04:00
|
|
|
SplitMethodName(dirp->d_name,client,server,name,digeststring,extra);
|
|
|
|
|
2004-08-08 10:02:11 -04:00
|
|
|
Debug("This request came from %s - our reply should be sent there!\n",client);
|
2004-06-17 07:21:42 -04:00
|
|
|
- strcpy(METHODREPLYTO,client);
|
|
|
|
+ (void)strlcpy(METHODREPLYTO,client,sizeof(METHODREPLYTO));
|
2004-08-08 10:02:11 -04:00
|
|
|
|
|
|
|
Debug("This request referred to us as %s - a plausible identity\n",client);
|
|
|
|
- strcpy(METHODFOR,server);
|
|
|
|
+ (void)strlcpy(METHODFOR,server,sizeof(METHODFOR));
|
|
|
|
|
2004-06-17 07:21:42 -04:00
|
|
|
if (strcmp(methodname,name) == 0)
|
|
|
|
{
|