Wed, 21 Sep 2011 16:06:14 +0200
Warning, downgrading software version due to TLS or TCP blocking defects in newest vendor version.
michael@377 | 1 | Index: main.c |
michael@377 | 2 | diff -Nau main.c.orig main.c |
michael@377 | 3 | --- main.c.orig 2009-12-10 14:11:03.590141302 +0100 |
michael@377 | 4 | +++ main.c 2009-12-10 14:11:07.246237908 +0100 |
michael@382 | 5 | @@ -952,6 +952,10 @@ |
michael@377 | 6 | ret=-1; |
michael@377 | 7 | my_argc=argc; my_argv=argv; |
michael@377 | 8 | |
michael@377 | 9 | + /* if (!log_stderr), that's not usable yet! '/ |
michael@377 | 10 | + /* ...so unconditionally log to syslog for now */ |
michael@377 | 11 | + openlog(argv[0], LOG_PID|LOG_CONS, log_facility); |
michael@377 | 12 | + |
michael@377 | 13 | /*init pkg mallocs (before parsing cfg or cmd line !)*/ |
michael@377 | 14 | if (init_pkg_mallocs()==-1) |
michael@377 | 15 | goto error00; |
michael@382 | 16 | @@ -1284,6 +1288,11 @@ |
michael@377 | 17 | |
michael@377 | 18 | /* init_daemon? */ |
michael@377 | 19 | if (!dont_fork){ |
michael@377 | 20 | + /* shortly after main() we called openlog(3) to log */ |
michael@377 | 21 | + /* the initialization, but since daemonize() has its */ |
michael@377 | 22 | + /* own syslog(3) handling, we need to close the log first */ |
michael@377 | 23 | + closelog(); /* close the initialization logging logic */ |
michael@377 | 24 | + |
michael@377 | 25 | if ( daemonize((log_name==0)?argv[0]:log_name, &own_pgid) <0 ) |
michael@377 | 26 | goto error; |
michael@377 | 27 | } |
michael@376 | 28 | Index: Makefile.defs |
michael@377 | 29 | diff -Nau Makefile.defs.orig Makefile.defs |
michael@377 | 30 | --- Makefile.defs.orig 2007-12-13 14:39:06.000000000 +0100 |
michael@377 | 31 | +++ Makefile.defs 2008-01-14 16:48:02.811615000 +0100 |
michael@382 | 32 | @@ -216,7 +216,7 @@ |
michael@377 | 33 | else |
michael@377 | 34 | doc-dir = doc/$(MAIN_NAME)/ |
michael@377 | 35 | man-dir = man/ |
michael@377 | 36 | - data-dir = $(MAIN_NAME)/ |
michael@377 | 37 | + data-dir = share/$(MAIN_NAME)/ |
michael@377 | 38 | LOCALBASE ?= $(SYSBASE)/local |
michael@377 | 39 | endif |
michael@377 | 40 | endif |
michael@382 | 41 | @@ -1427,6 +1427,10 @@ |
michael@377 | 42 | LIBS+= -lsctp |
michael@377 | 43 | endif |
michael@376 | 44 | |
michael@377 | 45 | +#conditionally add libfsl |
michael@376 | 46 | +LDFLAGS += -L$(prefix)/lib |
michael@376 | 47 | +LIBS += -lfsl |
michael@377 | 48 | + |
michael@377 | 49 | ifneq ($(found_lock_method), yes) |
michael@377 | 50 | $(warning No locking method found so far, trying SYS V sems) |
michael@377 | 51 | DEFS+= -DUSE_SYSV_SEM # try sys v sems |
michael@377 | 52 | Index: scripts/opensipsctl.8 |
michael@377 | 53 | diff -Nau scripts/opensipsctl.8.orig scripts/opensipsctl.8 |
michael@377 | 54 | --- scripts/opensipsctl.8.orig 2009-03-25 00:22:16.771365571 +0100 |
michael@377 | 55 | +++ scripts/opensipsctl.8 2009-03-25 00:22:34.295365555 +0100 |
michael@377 | 56 | @@ -20,8 +20,6 @@ |
michael@376 | 57 | |
michael@377 | 58 | .SH FILES |
michael@377 | 59 | .PD 0 |
michael@377 | 60 | -.I /etc/opensips/.opensipsctlrc |
michael@377 | 61 | -.br |
michael@377 | 62 | .I /usr/local/etc/opensips/.opensipsctlrc |
michael@377 | 63 | .br |
michael@377 | 64 | .I ~/.opensipsctlrc |
michael@377 | 65 | Index: scripts/osipsconsole |
michael@377 | 66 | diff -Nau scripts/osipsconsole.orig scripts/osipsconsole |
michael@377 | 67 | --- scripts/osipsconsole.orig 2009-12-08 03:31:32.633224883 +0100 |
michael@377 | 68 | +++ scripts/osipsconsole 2009-12-08 03:31:51.119960848 +0100 |
michael@377 | 69 | @@ -30,7 +30,6 @@ |
michael@377 | 70 | use Term::ReadLine; |
michael@377 | 71 | use DBI; |
michael@377 | 72 | use POSIX; |
michael@377 | 73 | -use Frontier::RPC2; |
michael@377 | 74 | use IO::Socket; |
michael@377 | 75 | use Socket; |
michael@377 | 76 | #use Net::IP; |
michael@382 | 77 | @@ -396,6 +395,12 @@ |
michael@377 | 78 | } |
michael@377 | 79 | } |
michael@376 | 80 | |
michael@377 | 81 | + if ( $MD5 eq "" ) { |
michael@377 | 82 | + if ( $arr[0] =~ /^\s*MD5/ ) { |
michael@377 | 83 | + $MD5 = $arr[1]; |
michael@377 | 84 | + } |
michael@377 | 85 | + } |
michael@377 | 86 | + |
michael@377 | 87 | if ( $AWK eq "" ) { |
michael@377 | 88 | if ( $arr[0] =~ /^\s*AWK/ ) { |
michael@377 | 89 | $AWK = $arr[1]; |
michael@376 | 90 | Index: modules/permissions/parse_config.c |
michael@377 | 91 | diff -Nau modules/permissions/parse_config.c.orig modules/permissions/parse_config.c |
michael@377 | 92 | --- modules/permissions/parse_config.c.orig 2008-08-03 15:54:01 +0200 |
michael@377 | 93 | +++ modules/permissions/parse_config.c 2008-08-09 11:58:55 +0200 |
michael@376 | 94 | @@ -114,8 +114,11 @@ |
michael@376 | 95 | except = strstr(str, " EXCEPT "); |
michael@376 | 96 | if (except) { |
michael@376 | 97 | /* exception found */ |
michael@376 | 98 | - strncpy(str2, str, except-str); |
michael@376 | 99 | - str2[except-str] = '\0'; |
michael@376 | 100 | + int l = except - str; |
michael@376 | 101 | + if (l > sizeof(str2) - 1) |
michael@376 | 102 | + l = sizeof(str2) - 1; |
michael@376 | 103 | + strncpy(str2, str, l); |
michael@376 | 104 | + str2[l] = '\0'; |
michael@376 | 105 | /* except+8 points to the exception */ |
michael@376 | 106 | if (parse_expression_list(except+8, e_exceptions)) { |
michael@376 | 107 | /* error */ |
michael@376 | 108 | @@ -124,7 +127,8 @@ |
michael@376 | 109 | } |
michael@376 | 110 | } else { |
michael@376 | 111 | /* no exception */ |
michael@376 | 112 | - strcpy(str2, str); |
michael@376 | 113 | + strncpy(str2, str, sizeof(str2)-1); |
michael@376 | 114 | + str2[sizeof(str2)-1] = '\0'; |
michael@376 | 115 | *e_exceptions = NULL; |
michael@376 | 116 | } |
michael@376 | 117 | |
michael@377 | 118 | Index: modules/nathelper/nathelper.c |
michael@377 | 119 | diff -Nau modules/nathelper/nathelper.c.orig modules/nathelper/nathelper.c |
michael@377 | 120 | --- modules/nathelper/nathelper.c.orig 2010-12-20 14:33:50.000000000 +0100 |
michael@377 | 121 | +++ modules/nathelper/nathelper.c 2011-01-26 17:48:40.685941382 +0100 |
michael@382 | 122 | @@ -273,6 +273,9 @@ |
michael@382 | 123 | #define MI_RECHECK_TICKS "recheck_ticks" |
michael@382 | 124 | #define MI_RECHECK_T_LEN (sizeof(MI_RECHECK_TICKS)-1) |
michael@376 | 125 | |
michael@377 | 126 | +/* MSvB macros */ |
michael@377 | 127 | +#define OPENSIPS_NOOP ((void)0) |
michael@377 | 128 | + |
michael@377 | 129 | |
michael@377 | 130 | |
michael@382 | 131 | /* Supported version of the RTP proxy command protocol */ |
michael@382 | 132 | @@ -1921,6 +1925,7 @@ |
michael@377 | 133 | #define FIX_MEDIP 0x02 |
michael@377 | 134 | #define ADD_ANORTPPROXY 0x04 |
michael@377 | 135 | #define FIX_ORGIP 0x08 |
michael@377 | 136 | +#define FIX_RTCPIP 0x10 |
michael@377 | 137 | |
michael@377 | 138 | #define ADIRECTION "a=direction:active" |
michael@377 | 139 | #define ADIRECTION_LEN (sizeof(ADIRECTION) - 1) |
michael@382 | 140 | @@ -2050,6 +2055,12 @@ |
michael@382 | 141 | return -1; |
michael@382 | 142 | } |
michael@382 | 143 | |
michael@382 | 144 | + if (level & FIX_RTCPIP) { |
michael@382 | 145 | + /* Iterate all a=rtcp: and replace ips in them. */ |
michael@382 | 146 | + if (replace_sdp_ip(msg, &body, "a=rtcp:", str2?&ip:0)==-1) |
michael@382 | 147 | + return -1; |
michael@382 | 148 | + } |
michael@382 | 149 | + |
michael@382 | 150 | return 1; |
michael@382 | 151 | } |
michael@382 | 152 | |
michael@382 | 153 | @@ -2215,7 +2226,9 @@ |
michael@377 | 154 | { |
michael@377 | 155 | char *buf; |
michael@377 | 156 | int offset; |
michael@377 | 157 | + int binlump; |
michael@377 | 158 | struct lump* anchor; |
michael@377 | 159 | + struct lump* templump; |
michael@377 | 160 | str omip, nip, oip; |
michael@377 | 161 | |
michael@377 | 162 | /* check that updating mediaip is really necessary */ |
michael@382 | 163 | @@ -2246,7 +2259,19 @@ |
michael@377 | 164 | memcpy(buf, CRLF, CRLF_LEN); |
michael@377 | 165 | memcpy(buf + CRLF_LEN, omip.s, omip.len); |
michael@377 | 166 | memcpy(buf + CRLF_LEN + omip.len, oldip->s, oldip->len); |
michael@377 | 167 | - if (insert_new_lump_after(anchor, buf, |
michael@377 | 168 | + |
michael@382 | 169 | + /* if the oldmediaip string is already */ |
michael@382 | 170 | + /* in the body then don't add it again */ |
michael@377 | 171 | + binlump = 0; |
michael@377 | 172 | + for (templump = msg->body_lumps; templump; templump = templump->next) |
michael@377 | 173 | + if (templump->op == LUMP_ADD && strstr(templump->u.value, buf)) |
michael@377 | 174 | + binlump = 1; |
michael@377 | 175 | + for (templump = msg->add_rm; templump; templump = templump->next) |
michael@377 | 176 | + if (templump->op == LUMP_ADD && strstr(templump->u.value, buf)) |
michael@377 | 177 | + binlump = 1; |
michael@377 | 178 | + if (strstr(body->s, buf) || binlump) |
michael@377 | 179 | + pkg_free(buf); |
michael@377 | 180 | + else if (insert_new_lump_after(anchor, buf, |
michael@377 | 181 | omip.len + oldip->len + CRLF_LEN, 0) == NULL) { |
michael@377 | 182 | LM_ERR("insert_new_lump_after failed\n"); |
michael@377 | 183 | pkg_free(buf); |
michael@377 | 184 | Index: parser/sdp/sdp_helpr_funcs.c |
michael@377 | 185 | diff -Nau parser/sdp/sdp_helpr_funcs.c.orig parser/sdp/sdp_helpr_funcs.c |
michael@377 | 186 | --- parser/sdp/sdp_helpr_funcs.c.orig 2010-12-08 15:14:06.000000000 +0100 |
michael@377 | 187 | +++ parser/sdp/sdp_helpr_funcs.c 2011-01-27 00:39:50.128212053 +0100 |
michael@377 | 188 | @@ -392,7 +392,7 @@ |
michael@377 | 189 | |
michael@377 | 190 | cp1 = NULL; |
michael@377 | 191 | for (cp = body->s; (len = body->s + body->len - cp) > 0;) { |
michael@377 | 192 | - cp1 = (char*)ser_memmem(cp, line, len, 2); |
michael@377 | 193 | + cp1 = (char*)ser_memmem(cp, line, len, strlen(line)); |
michael@377 | 194 | if (cp1 == NULL || cp1[-1] == '\n' || cp1[-1] == '\r') |
michael@377 | 195 | break; |
michael@377 | 196 | cp = cp1 + 2; |