bug-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Patch2: editfiles:SetCommentStart/SetCommentEnd ...


From: Mark . Burgess
Subject: Re: Patch2: editfiles:SetCommentStart/SetCommentEnd ...
Date: Wed, 24 Jan 2001 08:19:21 +0100 (MET)

On 23 Jan, Eric Berggren wrote:
> 
>   Okay, might as well be buffer-overflow conscience; here's an updated
> patch (disregard last one) which simply trades strncpy() for strcpy() :
> 
> -eric
> 
> *** orig/cf.extern.h  Tue Jan 23 14:38:42 2001
> --- cf.extern.h       Tue Jan 23 17:49:37 2001
> ***************
> *** 373,379 ****
>   extern int SEARCHREPLACELEVEL;
>   extern int FOREACHLEVEL;
>   
> ! extern char *COMMENTSTART, *COMMENTEND;
>   
>   /* GNU REGEXP */
>   
> --- 373,379 ----
>   extern int SEARCHREPLACELEVEL;
>   extern int FOREACHLEVEL;
>   
> ! extern char COMMENTSTART[], COMMENTEND[];
>   
>   /* GNU REGEXP */
>   
> *** orig/edittools.c  Tue Jan 23 14:38:42 2001
> --- edittools.c       Tue Jan 23 17:52:42 2001
> ***************
> *** 392,399 ****
>   EDITVERBOSE = VERBOSE;
>   CURRENTLINENUMBER = 1;
>   CURRENTLINEPTR = filestart;
> ! COMMENTSTART = "# ";
> ! COMMENTEND = "";
>   EDITGROUPLEVEL = 0;
>   SEARCHREPLACELEVEL = 0;
>   FOREACHLEVEL = 0;
> --- 392,399 ----
>   EDITVERBOSE = VERBOSE;
>   CURRENTLINENUMBER = 1;
>   CURRENTLINEPTR = filestart;
> ! strcpy(COMMENTSTART,"# ");
> ! strcpy(COMMENTEND,"");
>   EDITGROUPLEVEL = 0;
>   SEARCHREPLACELEVEL = 0;
>   FOREACHLEVEL = 0;
> ***************
> *** 568,578 ****
>                  break;
>   
>         case SetCommentStart:
> !                COMMENTSTART = expdata;
>                  break;
>   
>         case SetCommentEnd:
> !                COMMENTEND = expdata;
>                  break;
>   
>         case CommentLinesMatching:
> --- 568,580 ----
>                  break;
>   
>         case SetCommentStart:
> !                strncpy(COMMENTSTART,expdata,maxvarsize);
> !                COMMENTSTART[maxvarsize-1] = '\0';
>                  break;
>   
>         case SetCommentEnd:
> !                strncpy(COMMENTEND,expdata,maxvarsize);
> !                COMMENTEND[maxvarsize-1] = '\0';
>                  break;
>   
>         case CommentLinesMatching:
> *** orig/globals.c    Tue Jan 23 14:38:42 2001
> --- globals.c Tue Jan 23 17:49:37 2001
> ***************
> *** 695,702 ****
>   
>     PRIVATE int AUTOCREATED = 0;
>   
> !   PRIVATE char *COMMENTSTART;
> !   PRIVATE char *COMMENTEND;
>   
>     PUBLIC char *VEDITNAMES[] =
>        {
> --- 695,702 ----
>   
>     PRIVATE int AUTOCREATED = 0;
>   
> !   PRIVATE char COMMENTSTART[ maxvarsize ];
> !   PRIVATE char COMMENTEND[ maxvarsize ];
>   
>     PUBLIC char *VEDITNAMES[] =
>        {


Thanks for your patch which I will look at today. It seems that
it might break other things in cfengine, but I should be able
to extract the important bits. Thanks for the effort.

best
Mark

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Work: +47 22453272            Email:  address@hidden
Fax : +47 22453205            WWW  :  http://www.iu.hio.no/~mark
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~





reply via email to

[Prev in Thread] Current Thread [Next in Thread]