$OpenBSD: patch-src_parse_c,v 1.3 2004/10/01 21:22:15 sturm Exp $
--- src/parse.c.orig	Wed Aug 11 00:51:38 2004
+++ src/parse.c	Fri Oct  1 23:14:49 2004
@@ -256,7 +256,7 @@ SetStrategies(); 
 Debug1("\n\n==============================BEGIN NEW ACTION %s=============\n\n",ACTIONTEXT[action]);
 
 ACTION = action;
-strcpy(ACTIONBUFF,ACTIONTEXT[action]);
+(void)strlcpy(ACTIONBUFF,ACTIONTEXT[action],CF_BUFSIZE);
 
 switch (ACTION)
    {
@@ -282,7 +282,7 @@ switch (ACTION)
    }
 
 Debug1("\nResetting CLASS to ANY\n\n"); 
-strcpy(CLASSBUFF,CF_ANYCLASS);    /* default class */
+(void)strlcpy(CLASSBUFF,CF_ANYCLASS,CF_BUFSIZE);    /* default class */
 }
 
 /*******************************************************************/
@@ -298,7 +298,7 @@ Debug1("HandleLVALUE(%s) in action %s\n"
         
         if ((CONTROLVAR = ScanVariable(id)) != nonexistentvar)
            {
-           strcpy(CURRENTITEM,id);
+           (void)strlcpy(CURRENTITEM,id,CF_BUFSIZE);
            return;
            }
         else
@@ -339,7 +339,7 @@ Debug1("HandleLVALUE(%s) in action %s\n"
            yyerror("Reserved class name (choose a different name)");
            }
         
-        strcpy(GROUPBUFF,id);
+        (void)strlcpy(GROUPBUFF,id,CF_BUFSIZE);
         }
         
     break;
@@ -358,14 +358,14 @@ Debug1("HandleBraceObjectID(%s) in actio
 switch (ACTION)
    {
    case acls:
-       strcpy(CURRENTOBJECT,id);
+       (void)strlcpy(CURRENTOBJECT,id,CF_BUFSIZE);
        InstallACL(id,CLASSBUFF);
        break;
        
    case strategies:
        if (strlen(STRATEGYNAME) == 0)
           {
-          strcpy(STRATEGYNAME,id);
+          (void)strlcpy(STRATEGYNAME,id,CF_BUFSIZE);
           InstallStrategy(id,CLASSBUFF);
           }
        else
@@ -377,7 +377,7 @@ switch (ACTION)
    case editfiles:
        if (strlen(CURRENTOBJECT) == 0)
           {
-          strcpy(CURRENTOBJECT,id);
+          (void)strlcpy(CURRENTOBJECT,id,CF_BUFSIZE);
           EDITGROUPLEVEL = 0;
           FOREACHLEVEL = 0;
           SEARCHREPLACELEVEL = 0;
@@ -391,7 +391,7 @@ switch (ACTION)
    case filters:
        if (strlen(FILTERNAME)==0)
           {
-          strcpy(FILTERNAME,id);
+          (void)strlcpy(FILTERNAME,id,CF_BUFSIZE);
           InstallFilter(id);
           }
        else
@@ -417,7 +417,7 @@ switch (ACTION)
 
    case filters:
    case strategies:
-                 strcpy(CURRENTITEM,id);
+                 (void)strlcpy(CURRENTITEM,id,CF_BUFSIZE);
    break;
 
    case editfiles:
@@ -431,7 +431,7 @@ switch (ACTION)
                         HandleEdit(CURRENTOBJECT,id,NULL);
                         }
 
-   strcpy(CURRENTITEM,id);
+   (void)strlcpy(CURRENTITEM,id,CF_BUFSIZE);
        break;
    }
 }
@@ -467,7 +467,7 @@ else
    Debug1("Simple class = (%s)\n",id);
    }
 
-strcpy(CLASSBUFF,id); 
+(void)strlcpy(CLASSBUFF,id,CF_BUFSIZE); 
 }
 
 /*******************************************************************/
@@ -484,13 +484,13 @@ switch (ACTION)
         break;
         
     case filters:
-        strcpy(FILTERDATA,qstring);
+        (void)strlcpy(FILTERDATA,qstring,CF_BUFSIZE);
         ACTIONPENDING = true;
         InstallPending(ACTION); 
         break;
         
     case strategies:
-        strcpy(STRATEGYDATA,qstring);
+        (void)strlcpy(STRATEGYDATA,qstring,CF_BUFSIZE);
         ACTIONPENDING = true;
         InstallPending(ACTION); 
         break;
@@ -504,7 +504,7 @@ switch (ACTION)
               {
               yyerror("Processes syntax error");
               }
-           strcpy(RESTART,qstring);
+           (void)strlcpy(RESTART,qstring,CF_BUFSIZE);
            ACTIONPENDING = true;
            InstallPending(ACTION);
            
@@ -528,7 +528,7 @@ switch (ACTION)
               yyerror("Missing process search expression");
               }
            Debug1("Installing expression %s\n",qstring);
-           strcpy(EXPR,qstring);
+           (void)strlcpy(EXPR,qstring,CF_BUFSIZE);
            HAVE_RESTART = false;
            }
         else if (HAVE_RESTART)
@@ -633,7 +633,7 @@ if (ACTION == methods)
 if (IsBuiltinFunction(fn))
    {
    local[0] = '\0';
-   strcpy(local,EvaluateFunction(fn,local));
+   (void)strlcpy(local,EvaluateFunction(fn,local),sizeof(local));
    
    switch (ACTION)
       {
@@ -840,8 +840,8 @@ switch (ACTION)
           InstallPending(ACTION);
           InitializeAction();
           Debug1("\nFound SetOptionString\n");
-          strcpy(CURRENTOBJECT,"SetOptionString");
-          strcpy(EXPR,"SetOptionString");
+          (void)strlcpy(CURRENTOBJECT,"SetOptionString",CF_BUFSIZE);
+          (void)strlcpy(EXPR,"SetOptionString",CF_BUFSIZE);
           }
        else if (HAVE_RESTART)
           {
@@ -886,7 +886,7 @@ Debug("HandleServerRule(%s=%s)\n",object
  if (*buffer == '/')
     {
     Debug("\n\nNew admit/deny object=%s\n",buffer);
-    strcpy(CURRENTAUTHPATH,object);
+    (void)strlcpy(CURRENTAUTHPATH,object,CF_BUFSIZE);
     }
  else
     {
@@ -1026,7 +1026,7 @@ if ((yyin = fopen(filename,"r")) == NULL
    exit (1);
    }
  
-strcpy(VCURRENTFILE,filename);
+(void)strlcpy(VCURRENTFILE,filename,CF_BUFSIZE);
 
 Debug("\n##########################################################################\n"); 
 Debug("# BEGIN PARSING %s\n",VCURRENTFILE);
@@ -1107,7 +1107,7 @@ void RecordMacroId(char *name)
 
 {
 Debug("RecordMacroId(%s)\n",name);
-strcpy(CURRENTITEM,name); 
+(void)strlcpy(CURRENTITEM,name,CF_BUFSIZE); 
 
 if (strcmp(name,"this") == 0)
    {
@@ -1137,7 +1137,7 @@ if ((sp=getenv(CF_INPUTSVAR)) != NULL)
    {
    if (!IsAbsoluteFileName(filename))     /* Don't prepend to absolute names */
       { 
-      strcpy(result,sp);
+      (void)strlcpy(result,sp,CF_BUFSIZE);
       
       if (! IsAbsoluteFileName(result))
          {
@@ -1152,13 +1152,13 @@ if ((sp=getenv(CF_INPUTSVAR)) != NULL)
     {
     if (!IsAbsoluteFileName(filename))     /* Don't prepend to absolute names */
        { 
-       strcpy(result,WORKDIR);
+       (void)strlcpy(result,WORKDIR,CF_BUFSIZE);
        AddSlash(result);
-       strcat(result,"inputs/");
+       (void)strlcat(result,"inputs/",CF_BUFSIZE);
        }
     }
  
-strcat(result,filename);
+(void)strlcat(result,filename,CF_BUFSIZE);
 return result;
 }
 
@@ -1182,8 +1182,8 @@ void InitializeAction()                 
  HAVE_RESTART = false;
  VAGE = 99999;
  strncpy(FINDERTYPE,"*",CF_BUFSIZE);
- strcpy(VUIDNAME,"*");
- strcpy(VGIDNAME,"*");
+ (void)strlcpy(VUIDNAME,"*",CF_MAXVARSIZE);
+ (void)strlcpy(VGIDNAME,"*",CF_MAXVARSIZE);
  HAVE_RESTART = 0;
  FILEACTION=warnall;
  PIFELAPSED=-1;
@@ -1204,7 +1204,7 @@ void InitializeAction()                 
  PARSEMETHODRETURNCLASSES[0] = '\0';
  METHODFORCE[0] = '\0';
  CHROOT[0] = '\0';
- strcpy(VIFNAME,"");
+ (void)strlcpy(VIFNAME,"",sizeof(VIFNAME));
  PTRAVLINKS = (short) '?';
  IMAGEBACKUP = 'y';
  ENCRYPT = 'n';
@@ -1246,7 +1246,7 @@ void InitializeAction()                 
  memset(ALLCLASSBUFFER,0,CF_BUFSIZE);
  memset(ELSECLASSBUFFER,0,CF_BUFSIZE);
  
- strcpy(CFSERVER,"localhost");
+ (void)strlcpy(CFSERVER,"localhost",CF_MAXVARSIZE);
  
  IMGCOMP = DISCOMP='>';
  IMGSIZE = DISABLESIZE=CF_NOSIZE;
