add packages_10.03.2 in preparation for the 10.03.2 interim release
[10.03/packages.git] / net / ipupdate / patches / 100-name_conflict.patch
1 --- a/include/array.c
2 +++ b/include/array.c
3 @@ -1,7 +1,7 @@
4  #include "array.h"
5  
6  /*
7 -** split
8 +** array_split
9  **
10  ** Accepts a string argument converting all delimeters to nulls
11  ** Returns an allocated array pointer or NULL
12 @@ -14,7 +14,7 @@
13  ** str is not to be deallocated while using this array
14  */
15  
16 -char** split(char* str, const char* del, int* cnt)
17 +char** array_split(char* str, const char* del, int* cnt)
18  {
19         char** args = NULL;
20         int inc;
21 @@ -53,7 +53,7 @@ char** split(char* str, const char* del,
22  }
23  
24  /*
25 -** splice
26 +** array_splice
27  **
28  ** remove length elements from array starting at offset
29  ** All trailing elements will be left aligned
30 @@ -70,7 +70,7 @@ char** split(char* str, const char* del,
31  ** Returns the number of elements removed
32  */
33  
34 -int splice(void** array, int cnt, int offset, int length)
35 +int array_splice(void** array, int cnt, int offset, int length)
36  {
37         int t;
38  
39 --- a/include/array.h
40 +++ b/include/array.h
41 @@ -1,5 +1,5 @@
42  #include <string.h>
43  #include <stdlib.h>
44  
45 -char** split(char*, const char*, int*);
46 -int splice(void**, int, int, int);
47 +char** array_split(char*, const char*, int*);
48 +int array_splice(void**, int, int, int);
49 --- a/ipupdate.c
50 +++ b/ipupdate.c
51 @@ -295,7 +295,7 @@ int DoUpdate(int check)
52                                 free(zone->keyname);
53                                 free(server->zones[j]);
54  
55 -                               server->zonec -= splice((void**)server->zones, server->zonec, j, 1);
56 +                               server->zonec -= array_splice((void**)server->zones, server->zonec, j, 1);
57                                 continue;
58                         }
59  
60 @@ -317,7 +317,7 @@ int DoUpdate(int check)
61                         free(server->zones);
62                         free(cfg.servers[i]);
63  
64 -                       cfg.serverc -= splice((void**)cfg.servers, cfg.serverc, i, 1);
65 +                       cfg.serverc -= array_splice((void**)cfg.servers, cfg.serverc, i, 1);
66                         continue;
67                 }
68                 i++;
69 @@ -414,7 +414,7 @@ int checkcname(int *s, struct server *se
70                         asprintf(&msg, "checkcname: server %s: zone %s: host %s: host disabled", server->name, zone->name, zone->hosts[i]);
71                         PostMsgFree(msg);
72  
73 -                       zone->hostc -= splice((void**)zone->hosts, zone->hostc, i, 1);
74 +                       zone->hostc -= array_splice((void**)zone->hosts, zone->hostc, i, 1);
75                         continue;
76                 }
77  
78 @@ -446,7 +446,7 @@ int checkcname(int *s, struct server *se
79                         asprintf(&msg, "checkcname: server %s: zone %s: host %s: host disabled", server->name, zone->name, zone->hosts[i]);
80                         PostMsgFree(msg);
81         
82 -                       zone->hostc -= splice((void**)zone->hosts, zone->hostc, i, 1);
83 +                       zone->hostc -= array_splice((void**)zone->hosts, zone->hostc, i, 1);
84                         continue;
85                 }
86                 //append the record to the packet
87 @@ -488,7 +488,7 @@ int checkcname(int *s, struct server *se
88                         asprintf(&msg, "checkcname: server %s: zone %s: host %s: host disabled", server->name, zone->name, zone->hosts[i]);
89                         PostMsgFree(msg);
90  
91 -                       zone->hostc -= splice((void**)zone->hosts, zone->hostc, i, 1);
92 +                       zone->hostc -= array_splice((void**)zone->hosts, zone->hostc, i, 1);
93                         continue;
94                 }
95  
96 @@ -561,7 +561,7 @@ int checkip(int *s, struct server *serve
97                         asprintf(&msg, "checkip: server %s: zone %s: host %s: host disabled", server->name, zone->name, zone->hosts[i]);
98                         PostMsgFree(msg);
99  
100 -                       if (zone->hostc -= splice((void**)zone->hosts, zone->hostc, i, 1))
101 +                       if (zone->hostc -= array_splice((void**)zone->hosts, zone->hostc, i, 1))
102                         {
103                                 *((unsigned short*)&pkt.data[8]) = htons(zone->hostc);
104                                 continue;
105 --- a/config.c
106 +++ b/config.c
107 @@ -873,7 +873,7 @@ void cfg_zone(struct server *server, str
108                                 switch (cfg_readblock(data, &term, &ptr)) {
109                                 case CFG_QUOTED:
110                                         zone->hostp = term;
111 -                                       zone->hosts = split(zone->hostp, ", \t\r\n", &zone->hostc);
112 +                                       zone->hosts = array_split(zone->hostp, ", \t\r\n", &zone->hostc);
113                                         if (zone->hostc > 32767)
114                                         {
115                                                         asprintf(&msg, "getconfig: zone \"%s\": there may not be more than 32767 hosts", zone->name);