diff -ru cfengine-2.0.a14.orig/src/cfservd.c cfengine-2.0.a14/src/cfservd.c --- cfengine-2.0.a14.orig/src/cfservd.c Sun Sep 2 11:51:08 2001 +++ cfengine-2.0.a14/src/cfservd.c Sun Mar 31 10:41:41 2002 @@ -2379,7 +2379,7 @@ { Debug("***Closing socket %d from %s\n",conn->sd_reply,conn->ipaddr); -DeleteItemStarting(&CONNECTIONLIST,conn->ipaddr); +DeleteItemExact(&CONNECTIONLIST,conn->ipaddr); close(conn->sd_reply); free ((char *)conn); diff -ru cfengine-2.0.a14.orig/src/item-ext.c cfengine-2.0.a14/src/item-ext.c --- cfengine-2.0.a14.orig/src/item-ext.c Tue Aug 28 04:51:54 2001 +++ cfengine-2.0.a14/src/item-ext.c Sun Mar 31 10:40:20 2002 @@ -495,6 +495,7 @@ * function deletes item * ------------------------------------------------------------------------ * DeleteItemStarting literally equal to string item spec + * DeleteItemExact literally equal to *entire* string item spec * DeleteItemMatching fully matched by regex item spec * DeleteItemContaining containing string item spec */ @@ -527,6 +528,74 @@ } if (strncmp(ip->name,string,strlen(string)) == 0) + { + EditVerbose("Deleted item %s\n",ip->name); + if (ip == *list) + { + free((*list)->name); + if (ip->classes != NULL) + { + free(ip->classes); + } + *list = ip->next; + free((char *)ip); + + NUMBEROFEDITS++; + return true; + } + else + { + last->next = ip->next; + free(ip->name); + if (ip->classes != NULL) + { + free(ip->classes); + } + free((char *)ip); + + NUMBEROFEDITS++; + return true; + } + + } + last = ip; + } + +return false; +} + +/*********************************************************************/ + +/* + * Delete item exactly matching entire string, not just starting with + * the string spec + */ +int DeleteItemExact(list,string) + +struct Item **list; +char *string; + +{ struct Item *ip, *next, *last = NULL; + +if (list == NULL) + { + return false; + } + +for (ip = *list; ip != NULL; ip=ip->next) + { + if (ip->name == NULL) + { + continue; + } + + if (EDABORTMODE && ItemMatchesRegEx(ip->name,VEDITABORT)) + { + Verbose("Aborting search, regex %s matches line\n",VEDITABORT); + return false; + } + + if (strcmp(ip->name,string) == 0) { EditVerbose("Deleted item %s\n",ip->name); if (ip == *list)