~ubuntu-branches/ubuntu/karmic/centerim/karmic

« back to all changes in this revision

Viewing changes to debian/patches/fedora-security-patch.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Anibal Avelar (Fixxxer)
  • Date: 2007-09-30 20:15:20 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070930201520-gevbtc30gd09830x
Tags: 4.22.1.20071003-1
* Updated with the master branch development from 2007-10-03
* Removed the patch to build the package; it was built with the 
  centerim-20071003.tar.gz file, the latest mob branch snapshot.
* Updated with NMU security patch for CVE-2007-3713 report
* Fixed the FTBFS bug with GCC 4.3: missing some 'includes' (Closes: #417132)
* Fixed the FTBFS if build twice in a row (Closes: #442523, #424153, #442525)
* Fixed centericq segfault on some circustance (Closes: #363272)
* Fixed centericq failed with CPP error message (Closes: #295808)
* Fixed centericq: Cannot connect to AIM (Closes: #325456)
* Fixed centericq clumsily concocts creations where word wrap 
  wantonly works wrongly (Closes: #349133)
* Fixed centericq: users with blank names corrupt contact list 
  (Closes: #239263)
* Fixed centericq: CenterICQ fiendishly devours apostrophes sent from 
   users of Trillian (Closes: #266214)
* Fixed centericq: Yahoo contacts not deleted on the server side i
  (Closes: #303071)
* Fixed centericq: AIM shows some characters as HTML entities 
  (Closes: #263383)
* Fixed centericq: SSL support on Jabber (Closes: #223537)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /bin/sh /usr/share/dpatch/dpatch-run
2
 
## fedora-security-patch.dpatch by  <mithrandi@elvardein.mithrandi.za.net>
3
 
##
4
 
## All lines beginning with `## DP:' are a description of the patch.
5
 
## DP: No description.
6
 
 
7
 
@DPATCH@
8
 
diff -urNad centerim-4.22.1~/src/hooks/abstracthook.cc centerim-4.22.1/src/hooks/abstracthook.cc
9
 
--- centerim-4.22.1~/src/hooks/abstracthook.cc  2007-06-14 00:44:04.000000000 +0200
10
 
+++ centerim-4.22.1/src/hooks/abstracthook.cc   2007-08-21 22:10:58.959262015 +0200
11
 
@@ -40,6 +40,8 @@
12
 
 
13
 
 #include <time.h>
14
 
 
15
 
+#define NOTIFBUF 512
16
 
+
17
 
 time_t timer_current = time(0);
18
 
 
19
 
 abstracthook::abstracthook(protocolname aproto)
20
 
@@ -342,7 +344,7 @@
21
 
 
22
 
 void abstracthook::log(logevent ev, ...) {
23
 
     va_list ap;
24
 
-    char buf[512];
25
 
+    char buf[NOTIFBUF];
26
 
     static map<logevent, string> lst;
27
 
 
28
 
     if(lst.empty()) {
29
 
@@ -357,7 +359,8 @@
30
 
     }
31
 
 
32
 
     va_start(ap, ev);
33
 
-    vsprintf(buf, lst[ev].c_str(), ap);
34
 
+    vsnprintf(buf, NOTIFBUF, lst[ev].c_str(), ap);
35
 
+    buf[NOTIFBUF-1] = '\0';
36
 
     va_end(ap);
37
 
 
38
 
     face.log((string) "+ [" + conf.getprotocolname(proto)  + "] " + buf);
39
 
@@ -754,7 +757,7 @@
40
 
     if(id > 24 || id < -24) {
41
 
        return "Unspecified";
42
 
     } else {
43
 
-       char buf[32];
44
 
+       static char buf[32];
45
 
        sprintf(buf, "GMT %s%d:%s", id > 0 ? "-" : "+", abs(id/2), id % 2 == 0 ? "00" : "30");
46
 
        return buf;
47
 
     }
48
 
diff -urNad centerim-4.22.1~/src/hooks/aimhook.cc centerim-4.22.1/src/hooks/aimhook.cc
49
 
--- centerim-4.22.1~/src/hooks/aimhook.cc       2007-08-21 22:10:58.459347743 +0200
50
 
+++ centerim-4.22.1/src/hooks/aimhook.cc        2007-08-21 22:10:58.959262015 +0200
51
 
@@ -32,6 +32,8 @@
52
 
 #include "imlogger.h"
53
 
 #include "eventmanager.h"
54
 
 
55
 
+#define NOTIFBUF 512
56
 
+
57
 
 aimhook ahook;
58
 
 
59
 
 aimhook::aimhook()
60
 
@@ -293,8 +295,9 @@
61
 
     fname = conf.getconfigfname("aim-profile");
62
 
 
63
 
     if(access(fname.c_str(), R_OK)) {
64
 
-       char sbuf[512];
65
 
-       sprintf(sbuf, _("I do really enjoy the default AIM profile of centerim %s."), VERSION);
66
 
+       char sbuf[NOTIFBUF];
67
 
+       snprintf(sbuf, NOTIFBUF, _("I do really enjoy the default AIM profile of centerim %s."), VERSION);
68
 
+       sbuf[NOTIFBUF-1] = '\0';
69
 
        profile.info = sbuf;
70
 
        saveprofile();
71
 
     }
72
 
diff -urNad centerim-4.22.1~/src/hooks/irchook.cc centerim-4.22.1/src/hooks/irchook.cc
73
 
--- centerim-4.22.1~/src/hooks/irchook.cc       2007-08-21 22:10:58.459347743 +0200
74
 
+++ centerim-4.22.1/src/hooks/irchook.cc        2007-08-21 22:10:58.959262015 +0200
75
 
@@ -35,6 +35,8 @@
76
 
 
77
 
 #include <iterator>
78
 
 
79
 
+#define NOTIFBUF 512
80
 
+
81
 
 // ----------------------------------------------------------------------------
82
 
 
83
 
 irchook irhook;
84
 
@@ -610,11 +612,12 @@
85
 
 
86
 
 void irchook::channelfatal(string room, const char *fmt, ...) {
87
 
     va_list ap;
88
 
-    char buf[1024];
89
 
+    char buf[NOTIFBUF];
90
 
     vector<channelInfo>::iterator i;
91
 
 
92
 
     va_start(ap, fmt);
93
 
-    vsprintf(buf, fmt, ap);
94
 
+    vsnprintf(buf, NOTIFBUF, fmt, ap);
95
 
+    buf[NOTIFBUF-1] = '\0';
96
 
     va_end(ap);
97
 
 
98
 
     if(room.substr(0, 1) != "#")
99
 
@@ -1197,7 +1200,7 @@
100
 
 void irchook::nickchanged(void *connection, void *cli, ...) {
101
 
     va_list ap;
102
 
     icqcontact *c;
103
 
-    char buf[100];
104
 
+    char buf[NOTIFBUF];
105
 
 
106
 
     va_start(ap, cli);
107
 
     char *oldnick = va_arg(ap, char *);
108
 
@@ -1219,7 +1222,8 @@
109
 
 
110
 
            }
111
 
 
112
 
-           sprintf(buf, _("The user has changed their nick from %s to %s"), oldnick, newnick);
113
 
+           snprintf(buf, NOTIFBUF, _("The user has changed their nick from %s to %s"), oldnick, newnick);
114
 
+           buf[NOTIFBUF-1] = '\0';
115
 
            em.store(imnotification(c, buf));
116
 
        }
117
 
     }
118
 
@@ -1255,18 +1259,20 @@
119
 
 
120
 
 void irchook::subreply(void *conn, void *cli, const char * const nick,
121
 
 const char * const command, const char * const args) {
122
 
-    char buf[512];
123
 
+    char buf[NOTIFBUF];
124
 
 
125
 
     if(!strcmp(command, "PING")) {
126
 
        map<string, time_t>::iterator i = irhook.pingtime.find(up(nick));
127
 
 
128
 
        if(i != irhook.pingtime.end()) {
129
 
-           sprintf(buf, _("PING reply from the user: %d second(s)"), time(0)-i->second);
130
 
+           snprintf(buf, NOTIFBUF, _("PING reply from the user: %d second(s)"), time(0)-i->second);
131
 
+           buf[NOTIFBUF-1] = '\0';
132
 
            em.store(imnotification(imcontact(nick, irc), buf));
133
 
        }
134
 
 
135
 
     } else if(!strcmp(command, "VERSION")) {
136
 
-       sprintf(buf, _("The remote is using %s"), args);
137
 
+       snprintf(buf, NOTIFBUF, _("The remote is using %s"), args);
138
 
+       buf[NOTIFBUF-1] = '\0';
139
 
        em.store(imnotification(imcontact(nick, irc), buf));
140
 
 
141
 
     }
142
 
@@ -1379,8 +1385,9 @@
143
 
        if(strlen(email))
144
 
            uname += (string) " (" + email + ")";
145
 
 
146
 
-       char buf[512];
147
 
-       sprintf(buf, _("%s has joined."), uname.c_str());
148
 
+       char buf[NOTIFBUF];
149
 
+       snprintf(buf, NOTIFBUF, _("%s has joined."), uname.c_str());
150
 
+       buf[NOTIFBUF-1] = '\0';
151
 
        em.store(imnotification(imcontact(room, irc), buf));
152
 
     }
153
 
 }
154
 
@@ -1397,15 +1404,17 @@
155
 
     if(conf.getourid(irc).nickname != who) {
156
 
        string text;
157
 
        string text2;
158
 
-       char buf[512];
159
 
+       char buf[NOTIFBUF];
160
 
 
161
 
-       sprintf(buf, _("%s has left"), who); text = buf;
162
 
+       snprintf(buf, NOTIFBUF, _("%s has left"), who); text = buf;
163
 
+       buf[NOTIFBUF-1] = '\0';
164
 
 
165
 
        if(reason)
166
 
        if(strlen(reason)) {
167
 
            if(strlen(reason) > 450) reason[450] = 0;
168
 
            text2 = irhook.rushtmlconv( "wk", reason );
169
 
-           sprintf(buf, _("reason: %s"), text2.c_str() );
170
 
+           snprintf(buf, NOTIFBUF, _("reason: %s"), text2.c_str());
171
 
+           buf[NOTIFBUF-1] = '\0';
172
 
            text += (string) "; " + buf + ".";
173
 
        }
174
 
 
175
 
@@ -1425,13 +1434,15 @@
176
 
 
177
 
     if(conf.getourid(irc).nickname != who) {
178
 
        string text;
179
 
-       char buf[512];
180
 
+       char buf[NOTIFBUF];
181
 
 
182
 
-       sprintf(buf, _("%s has been kicked by %s"), who, by); text = buf;
183
 
+       snprintf(buf, NOTIFBUF, _("%s has been kicked by %s"), who, by); text = buf;
184
 
+       buf[NOTIFBUF-1] = '\0';
185
 
 
186
 
        if(reason)
187
 
        if(strlen(reason)) {
188
 
-           sprintf(buf, _("reason: %s"), reason);
189
 
+           snprintf(buf, NOTIFBUF, _("reason: %s"), reason);
190
 
+           buf[NOTIFBUF-1] = '\0';
191
 
            text += (string) "; " + buf + ".";
192
 
        }
193
 
 
194
 
@@ -1454,14 +1465,16 @@
195
 
        return;
196
 
 
197
 
     string text;
198
 
-    char buf[1024];
199
 
+    char buf[NOTIFBUF];
200
 
     text = irhook.rushtmlconv( "wk", topic );
201
 
-    sprintf(buf, _("Channel topic now is: %s"), text.c_str());
202
 
+    snprintf(buf, NOTIFBUF, _("Channel topic now is: %s"), text.c_str());
203
 
+    buf[NOTIFBUF-1] = '\0';
204
 
     text = buf;
205
 
 
206
 
     if(author)
207
 
     if(strlen(author)) {
208
 
-       sprintf(buf, _("set by %s"), author);
209
 
+       snprintf(buf, NOTIFBUF, _("set by %s"), author);
210
 
+       buf[NOTIFBUF-1] = '\0';
211
 
        text += (string) "; " + buf + ".";
212
 
     }
213
 
 
214
 
@@ -1478,8 +1491,9 @@
215
 
     va_end(ap);
216
 
 
217
 
     if(by) {
218
 
-       char buf[512];
219
 
-       sprintf(buf, _("%s has been opped by %s."), who, by);
220
 
+       char buf[NOTIFBUF];
221
 
+       snprintf(buf, NOTIFBUF, _("%s has been opped by %s."), who, by);
222
 
+       buf[NOTIFBUF-1] = '\0';
223
 
        em.store(imnotification(imcontact(room, irc), buf));
224
 
     }
225
 
 }
226
 
@@ -1494,8 +1508,9 @@
227
 
     va_end(ap);
228
 
 
229
 
     if(by) {
230
 
-       char buf[512];
231
 
-       sprintf(buf, _("%s has been deopped by %s."), who, by);
232
 
+       char buf[NOTIFBUF];
233
 
+       snprintf(buf, NOTIFBUF, _("%s has been deopped by %s."), who, by);
234
 
+       buf[NOTIFBUF-1] = '\0';
235
 
        em.store(imnotification(imcontact(room, irc), buf));
236
 
     }
237
 
 }
238
 
@@ -1508,10 +1523,10 @@
239
 
     char *by = va_arg(ap, char *);
240
 
     va_end(ap);
241
 
 
242
 
-    char buf[512];
243
 
-    if(by) sprintf(buf, _("%s has opped us."), by);
244
 
-       else strcpy(buf, _("you are an op here"));
245
 
-
246
 
+    char buf[NOTIFBUF];
247
 
+    if(by) snprintf(buf, NOTIFBUF, _("%s has opped us."), by);
248
 
+       else strncpy(buf, _("you are an op here"), NOTIFBUF);
249
 
+    buf[NOTIFBUF-1] = '\0';
250
 
     em.store(imnotification(imcontact(room, irc), buf));
251
 
 }
252
 
 
253
 
@@ -1523,8 +1538,9 @@
254
 
     char *by = va_arg(ap, char *);
255
 
     va_end(ap);
256
 
 
257
 
-    char buf[512];
258
 
-    sprintf(buf, _("%s has deopped us."), by);
259
 
+    char buf[NOTIFBUF];
260
 
+    snprintf(buf, NOTIFBUF, _("%s has deopped us."), by);
261
 
+    buf[NOTIFBUF-1] = '\0';
262
 
     em.store(imnotification(imcontact(room, irc), buf));
263
 
 }
264
 
 
265
 
diff -urNad centerim-4.22.1~/src/hooks/jabberhook.cc centerim-4.22.1/src/hooks/jabberhook.cc
266
 
--- centerim-4.22.1~/src/hooks/jabberhook.cc    2007-08-21 22:10:58.459347743 +0200
267
 
+++ centerim-4.22.1/src/hooks/jabberhook.cc     2007-08-21 22:10:58.959262015 +0200
268
 
@@ -36,6 +36,8 @@
269
 
 #define DEFAULT_CONFSERV "conference.jabber.org"
270
 
 #define PERIOD_KEEPALIVE 30
271
 
 
272
 
+#define NOTIFBUF 512
273
 
+
274
 
 static void jidsplit(const string &jid, string &user, string &host, string &rest) {
275
 
     int pos;
276
 
     user = jid;
277
 
@@ -1431,8 +1433,9 @@
278
 
        if(vinfo.size() > 128)
279
 
            vinfo.erase(128);
280
 
 
281
 
-       char buf[256];
282
 
-       sprintf(buf, _("The remote is using %s"), vinfo.c_str());
283
 
+       char buf[NOTIFBUF];
284
 
+       snprintf(buf, NOTIFBUF, _("The remote is using %s"), vinfo.c_str());
285
 
+       buf[NOTIFBUF-1] = '\0';
286
 
        em.store(imnotification(ic, buf));
287
 
     }
288
 
 }
289
 
diff -urNad centerim-4.22.1~/src/hooks/ljhook.cc centerim-4.22.1/src/hooks/ljhook.cc
290
 
--- centerim-4.22.1~/src/hooks/ljhook.cc        2007-06-14 00:44:04.000000000 +0200
291
 
+++ centerim-4.22.1/src/hooks/ljhook.cc 2007-08-21 22:10:58.959262015 +0200
292
 
@@ -37,6 +37,8 @@
293
 
 
294
 
 #define PERIOD_FRIENDS  3600
295
 
 
296
 
+#define NOTIFBUF 512
297
 
+
298
 
 ljhook::ljhook(): abstracthook(livejournal), fonline(false), sdest(0) {
299
 
     fcapabs.insert(hookcapab::nochat);
300
 
 }
301
 
@@ -654,7 +656,7 @@
302
 
            map<string, string> nfriendof;
303
 
            map<string, string>::const_iterator in;
304
 
            vector<string>::iterator il;
305
 
-           char buf[512];
306
 
+           char buf[NOTIFBUF];
307
 
 
308
 
            for(i = 1; i <= count; i++) {
309
 
                username = params[(string) "friendof_" + i2str(i) + "_user"];
310
 
@@ -669,8 +671,9 @@
311
 
                if(!foempty) {
312
 
                    bd = (string) "http://" + conf.getourid(proto).server + "/users/" + in->first;
313
 
 
314
 
-                   snprintf(buf, sizeof(buf), _("The user %s (%s) has added you to his/her friend list\n\nJournal address: %s"),
315
 
+                   snprintf(buf, NOTIFBUF, _("The user %s (%s) has added you to his/her friend list\n\nJournal address: %s"),
316
 
                        in->first.c_str(), in->second.c_str(), bd.c_str());
317
 
+                   buf[NOTIFBUF-1] = '\0';
318
 
 
319
 
                    em.store(imnotification(self, buf));
320
 
                }
321
 
@@ -679,8 +682,9 @@
322
 
            for(il = friendof.begin(); il != friendof.end(); ) {
323
 
                if(nfriendof.find(*il) == nfriendof.end()) {
324
 
                    bd = (string) "http://" + conf.getourid(proto).server + "/users/" + *il;
325
 
-                   snprintf(buf, sizeof(buf), _("The user %s has removed you from his/her friend list\n\nJournal address: %s"),
326
 
+                   snprintf(buf, NOTIFBUF, _("The user %s has removed you from his/her friend list\n\nJournal address: %s"),
327
 
                        il->c_str(), bd.c_str());
328
 
+                   buf[NOTIFBUF-1] = '\0';
329
 
                    em.store(imnotification(self, buf));
330
 
                    friendof.erase(il);
331
 
                    il = friendof.begin();
332
 
diff -urNad centerim-4.22.1~/src/hooks/yahoohook.cc centerim-4.22.1/src/hooks/yahoohook.cc
333
 
--- centerim-4.22.1~/src/hooks/yahoohook.cc     2007-08-21 22:10:58.459347743 +0200
334
 
+++ centerim-4.22.1/src/hooks/yahoohook.cc      2007-08-21 22:10:58.959262015 +0200
335
 
@@ -47,6 +47,8 @@
336
 
 #define PERIOD_REFRESH          60
337
 
 #define PERIOD_CLOSE            6
338
 
 
339
 
+#define NOTIFBUF 512
340
 
+
341
 
 int yahoohook::yfd::connection_tags = 0;
342
 
 
343
 
 char pager_host[255], pager_port[255], filetransfer_host[255],
344
 
@@ -852,7 +854,7 @@
345
 
     icqconf::imaccount acc = conf.getourid(yahoo);
346
 
     string confname = (string) "#" + room, inviter, text;
347
 
     vector<string>::iterator ic;
348
 
-    char buf[1024];
349
 
+    char buf[NOTIFBUF];
350
 
     int i;
351
 
 
352
 
     imcontact cont(confname, yahoo);
353
 
@@ -864,10 +866,11 @@
354
 
        inviter.erase(i);
355
 
     }
356
 
 
357
 
-    sprintf(buf, _("The user %s has invited you to the %s conference, the topic there is: %s"),
358
 
+    snprintf(buf, NOTIFBUF, _("The user %s has invited you to the %s conference, the topic there is: %s"),
359
 
        yhook.rusconv("wk", inviter).c_str(),
360
 
        yhook.rusconv("wk", room).c_str(),
361
 
        yhook.rusconv("wk", msg).c_str());
362
 
+    buf[NOTIFBUF-1] = '\0';
363
 
 
364
 
     text = (string) buf + "\n\n" + _("Current conference members are: ");
365
 
     yhook.confmembers[room].push_back(inviter);
366
 
@@ -896,20 +899,22 @@
367
 
 
368
 
 void yahoohook::conf_userdecline(int id, char *who, char *room, char *msg) {
369
 
     icqcontact *c = clist.get(imcontact((string) "#" + room, yahoo));
370
 
-    char buf[512];
371
 
+    char buf[NOTIFBUF];
372
 
 
373
 
     if(c) {
374
 
-       sprintf(buf, _("The user %s has declined your invitation to join the conference"), who);
375
 
+       snprintf(buf, NOTIFBUF, _("The user %s has declined your invitation to join the conference"), who);
376
 
+       buf[NOTIFBUF-1] = '\0';
377
 
        em.store(imnotification(c, buf));
378
 
     }
379
 
 }
380
 
 
381
 
 void yahoohook::conf_userjoin(int id, char *who, char *room) {
382
 
     icqcontact *c = clist.get(imcontact((string) "#" + room, yahoo));
383
 
-    char buf[512];
384
 
+    char buf[NOTIFBUF];
385
 
 
386
 
     if(c) {
387
 
-       sprintf(buf, _("The user %s has joined the conference"), who);
388
 
+       snprintf(buf, NOTIFBUF, _("The user %s has joined the conference"), who);
389
 
+       buf[NOTIFBUF-1] = '\0';
390
 
 
391
 
        if(find(yhook.confmembers[room].begin(), yhook.confmembers[room].end(), who) == yhook.confmembers[room].end())
392
 
            yhook.confmembers[room].push_back(who);
393
 
@@ -920,11 +925,12 @@
394
 
 
395
 
 void yahoohook::conf_userleave(int id, char *who, char *room) {
396
 
     icqcontact *c = clist.get(imcontact((string) "#" + room, yahoo));
397
 
-    char buf[512];
398
 
+    char buf[NOTIFBUF];
399
 
     vector<string>::iterator im;
400
 
 
401
 
     if(c) {
402
 
-       sprintf(buf, _("The user %s has left the conference"), who);
403
 
+       snprintf(buf, NOTIFBUF, _("The user %s has left the conference"), who);
404
 
+       buf[NOTIFBUF-1] = '\0';
405
 
        em.store(imnotification(c, buf));
406
 
 
407
 
        im = find(yhook.confmembers[room].begin(), yhook.confmembers[room].end(), who);
408
 
@@ -989,10 +995,11 @@
409
 
 }
410
 
 
411
 
 void yahoohook::mail_notify(int id, char *from, char *subj, int cnt) {
412
 
-    char buf[1024];
413
 
+    char buf[NOTIFBUF];
414
 
 
415
 
     if(from && subj) {
416
 
-       sprintf(buf, _("+ [yahoo] e-mail from %s, %s"), from, subj);
417
 
+       snprintf(buf, NOTIFBUF, _("+ [yahoo] e-mail from %s, %s"), from, subj);
418
 
+       buf[NOTIFBUF-1] = '\0';
419
 
        face.log(buf);
420
 
        clist.get(contactroot)->playsound(imevent::email);
421
 
     }
422
 
@@ -1146,11 +1153,12 @@
423
 
 
424
 
 int yahoohook::ylog(char *fmt, ...) {
425
 
     if(conf.getdebug()) {
426
 
-       char buf[512];
427
 
+       char buf[NOTIFBUF];
428
 
        va_list ap;
429
 
 
430
 
        va_start(ap, fmt);
431
 
-       vsprintf(buf, fmt, ap);
432
 
+       vsnprintf(buf, NOTIFBUF, fmt, ap);
433
 
+       buf[NOTIFBUF-1] = '\0';
434
 
        va_end(ap);
435
 
 
436
 
        face.log(buf);