[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [PATCH] Segfault doing copy recurse with purge
From: |
Bas van der Vlies |
Subject: |
RE: [PATCH] Segfault doing copy recurse with purge |
Date: |
Wed, 15 May 2002 14:07:20 +0200 (MET DST) |
To my knowledge this is already fixed in 2.0.1. I had the same problem as
posted also a fix ;-)
On 15-May-2002 Adrian Phillips wrote:
>
> While doing a copy action with purge on I was getting segfaults;
> noticed that exclusion was being used without being set. I'm not
> hundred percent certain of this patch, it seems to work, ie. no
> segfaults but I'm not sure which exclude to use the copy exclude or
> the global exclude :-
>
> Sincerely,
>
> Adrian Phillips
>
> diff -urN cfengine-2.0.0/src/image.c cfengine-2.0.0-hacked/src/image.c
> --- cfengine-2.0.0/src/image.c Thu Feb 14 07:46:46 2002
> +++ cfengine-2.0.0-hacked/src/image.c Wed May 15 06:20:37 2002
> @@ -198,7 +198,7 @@
>
> if (ip->purge == 'y')
> {
> - PurgeFiles(namecache,to);
> + PurgeFiles(namecache,to,ip->exclusions);
> DeleteItemList(namecache);
> }
>
> @@ -478,10 +478,11 @@
>
> /*********************************************************************/
>
> -void PurgeFiles(filelist,directory)
> +void PurgeFiles(filelist,directory,exclusions)
>
> struct Item *filelist;
> char *directory;
> +struct Item *exclusions;
>
> { DIR *dirh;
> struct stat statbuf;
> @@ -551,6 +552,7 @@
> tp.tidylist = &tpat;
> tp.next = NULL;
> tp.path = filename;
> + tp.exclusions = exclusions;
>
> tpat.recurse = INFINITERECURSE;
> tpat.age = 0;
> @@ -1312,7 +1314,7 @@
> if (S_ISDIR(s.st_mode))
> {
> backupisdir = true;
> - PurgeFiles(NULL,backup);
> + PurgeFiles(NULL,backup,NULL);
> rmdir(backup);
> }
>
> @@ -1332,7 +1334,7 @@
> {
> if (S_ISDIR(s.st_mode))
> {
> - PurgeFiles(NULL,dest);
> + PurgeFiles(NULL,dest,NULL);
> rmdir(dest);
> }
> }
> diff -urN cfengine-2.0.0/src/prototypes.h
> cfengine-2.0.0-hacked/src/prototypes.h
> --- cfengine-2.0.0/src/prototypes.h Wed May 15 06:21:22 2002
> +++ cfengine-2.0.0-hacked/src/prototypes.h Wed May 15 05:52:03 2002
> @@ -351,7 +351,7 @@
> void RecursiveImage ARGLIST((struct Image *ip, char *from, char *to, int
> maxrecurse));
> void CheckHomeImages ARGLIST((struct Image *ip));
> void CheckImage ARGLIST((char *source, char *destination, struct Image
> *ip));
> -void PurgeFiles ARGLIST((struct Item *filelist, char *directory));
> +void PurgeFiles ARGLIST((struct Item *filelist, char *directory, struct Item
> *exclusions));
> void ImageCopy ARGLIST((char *sourcefile, char *destfile, struct stat
> sourcestatbuf, struct Image *ip));
> int cfstat ARGLIST((char *file, struct stat *buf, struct Image *ip));
> int cflstat ARGLIST((char *file, struct stat *buf, struct Image *ip));
>
>
> --
> Your mouse has moved.
> Windows NT must be restarted for the change to take effect.
> Reboot now? [OK]
>
> _______________________________________________
> Bug-cfengine mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/bug-cfengine
--
********************************************************************
* *
* Bas van der Vlies e-mail: address@hidden *
* SARA - Academic Computing Services phone: +31 20 592 8012 *
* Kruislaan 415 fax: +31 20 6683167 *
* 1098 SJ Amsterdam WWW: www.sara.nl *
* *
********************************************************************