FS-11911: Fix build on Debian Buster

This commit is contained in:
Andrey Volk 2019-06-19 23:53:35 +04:00
parent 4f50a24a90
commit a7477ed0e2
24 changed files with 36 additions and 50 deletions

2
debian/bootstrap.sh vendored
View File

@ -28,7 +28,7 @@ conf_dir="../conf"
lang_dir="../conf/vanilla/lang"
fs_description="FreeSWITCH is a scalable open source cross-platform telephony platform designed to route and interconnect popular communication protocols using audio, video, text or any other form of media."
mod_build_depends="." mod_depends="." mod_recommends="." mod_suggests="."
supported_debian_distros="wheezy jessie stretch sid"
supported_debian_distros="wheezy jessie stretch buster sid"
supported_ubuntu_distros="trusty utopic xenial"
supported_distros="$supported_debian_distros $supported_ubuntu_distros"
avoid_mods=(

View File

@ -479,6 +479,7 @@ Module: endpoints/mod_verto
Description: Adds mod_verto.
Adds mod_verto.
Build-Depends: libperl-dev
Build-Depends-Buster: libperl-dev, libgdbm-compat-dev
## mod/event_handlers
@ -635,7 +636,7 @@ Description: Adds mod_basic.
Module: languages/mod_java
Description: mod_java
Adds mod_java.
Build-Depends: default-jdk, gcj-jdk
Build-Depends: default-jdk
Module: languages/mod_lua
Description: mod_lua
@ -651,6 +652,7 @@ Module: languages/mod_perl
Description: mod_perl
Adds mod_perl.
Build-Depends: libperl-dev
Build-Depends-Buster: libperl-dev, libgdbm-compat-dev
Module: languages/mod_python
Description: mod_python

View File

@ -50,7 +50,7 @@ static unsigned char esl_console_complete(const char *buffer, const char *cursor
#endif
typedef struct {
char name[128];
char name[256];
char host[128];
esl_port_t port;
char user[256];
@ -1267,7 +1267,7 @@ static void read_config(const char *dft_cfile, const char *cfile) {
if (esl_config_open_file(&cfg, cfile) ||
esl_config_open_file(&cfg, dft_cfile)) {
char *var, *val;
char cur_cat[128] = "";
char cur_cat[256] = "";
while (esl_config_next_pair(&cfg, &var, &val)) {
if (strcmp(cur_cat, cfg.category)) {
esl_set_string(cur_cat, cfg.category);
@ -1470,7 +1470,7 @@ int main(int argc, char *argv[])
int argv_error = 0;
int argv_exec = 0;
char argv_command[1024] = "";
char argv_loglevel[128] = "";
char argv_loglevel[127] = "";
int argv_log_uuid = 0;
int argv_log_uuid_short = 0;
int argv_quiet = 0;

View File

@ -1399,7 +1399,7 @@ ESL_DECLARE(esl_status_t) esl_recv_event(esl_handle_t *handle, int check_q, esl_
hval = esl_event_get_header(revent, "reply-text");
if (!esl_strlen_zero(hval)) {
strncpy(handle->last_reply, hval, sizeof(handle->last_reply));
snprintf(handle->last_reply, sizeof(handle->last_reply), "%s", hval);
}
hval = esl_event_get_header(revent, "content-type");
@ -1597,7 +1597,7 @@ ESL_DECLARE(esl_status_t) esl_send_recv_timed(esl_handle_t *handle, const char *
hval = esl_event_get_header(handle->last_sr_event, "reply-text");
if (!esl_strlen_zero(hval)) {
strncpy(handle->last_sr_reply, hval, sizeof(handle->last_sr_reply));
snprintf(handle->last_sr_reply, sizeof(handle->last_sr_reply), "%s", hval);
}
}
}

View File

@ -40,8 +40,8 @@
extern "C" {
#endif /* defined(__cplusplus) */
#define esl_copy_string(_x, _y, _z) strncpy(_x, _y, _z - 1)
#define esl_set_string(_x, _y) esl_copy_string(_x, _y, sizeof(_x))
#define esl_copy_string(_x, _y, _z) snprintf(_x, _z, "%s", _y)
#define esl_set_string(_x, _y) esl_copy_string(_x, _y, sizeof(_x))
#define ESL_VA_NONE "%s", ""
typedef struct esl_event_header esl_event_header_t;

View File

@ -113,7 +113,7 @@ struct esl_config {
/*! FILE stream buffer to the opened file */
FILE *file;
/*! path to the file */
char path[512];
char path[1024];
/*! current category */
char category[256];
/*! current section */

View File

@ -58,7 +58,7 @@ getDevicesFromMiniSSDPD(const char * devtype, const char * socketpath)
return NULL;
}
addr.sun_family = AF_UNIX;
strncpy(addr.sun_path, socketpath, sizeof(addr.sun_path));
memcpy(addr.sun_path, socketpath, sizeof(addr.sun_path));
if(connect(s, (struct sockaddr *)&addr, sizeof(struct sockaddr_un)) < 0)
{
/*syslog(LOG_WARNING, "connect(\"%s\"): %m", socketpath);*/

View File

@ -34,6 +34,7 @@
#include "config.h"
#include <string.h>
#include <stdio.h>
#include "sofia-sip/su_alloc.h"
/** Duplicate a string, allocate memory from @a home.
@ -54,7 +55,7 @@ char *su_strdup(su_home_t *home, char const *s)
size_t n = strlen(s);
char *retval = su_alloc(home, n + 1);
if (retval)
strncpy(retval, s, n)[n] = 0;
snprintf(retval, n + 1, "%s", s);
return retval;
}
return NULL;

View File

@ -111,10 +111,6 @@ typedef int gid_t;
#include <io.h>
#define strcasecmp(s1, s2) stricmp(s1, s2)
#define strncasecmp(s1, s2, n) strnicmp(s1, s2, n)
#if _MSC_VER < 1900
#define snprintf _snprintf
#endif
#else
/* packed attribute */
#if (defined __SUNPRO_CC) || defined(__SUNPRO_C)

View File

@ -35,9 +35,6 @@
#ifdef _MSC_VER
#include <io.h>
#include <WinSock2.h>
#if _MSC_VER < 1900
#define snprintf _snprintf
#endif
typedef SOCKET credis_socket_t;
#define CREDIS_SOCK_INVALID INVALID_SOCKET
#else

View File

@ -302,7 +302,7 @@ static ks_status_t mod_signalwire_adoption_post(void)
status = KS_STATUS_FAIL;
goto done;
}
strncpy(globals.adoption_data_external_ip, external_ip, sizeof(globals.adoption_data_external_ip));
snprintf(globals.adoption_data_external_ip, sizeof(globals.adoption_data_external_ip), "%s", external_ip);
}
if (!globals.adoption_data_uname[0]) {
@ -609,7 +609,7 @@ static switch_status_t mod_signalwire_load_or_generate_token(void)
token[len - 1] = '\0';
}
strncpy(globals.adoption_token, token, sizeof(globals.adoption_token) - 1);
snprintf(globals.adoption_token, sizeof(globals.adoption_token), "%s", token);
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO,
@ -674,7 +674,7 @@ static switch_status_t load_config()
}
if ((data = getenv("SW_ADOPTION_SERVICE"))) {
strncpy(globals.adoption_service, data, sizeof(globals.adoption_service));
snprintf(globals.adoption_service, sizeof(globals.adoption_service), "%s", data);
}
swclt_config_load_from_env(globals.config);
@ -1032,7 +1032,7 @@ static void mod_signalwire_state_online(void)
static void mod_signalwire_state_configure(void)
{
switch_memory_pool_t *pool = NULL;
char local_ip[256];
char local_ip[64];
switch_port_t local_port = 6050;
char local_endpoint[256];
char *external_ip;

View File

@ -5760,7 +5760,7 @@ void general_event_handler(switch_event_t *event)
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "EVENT_TRAP: IP change detected\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "IP change detected [%s]->[%s] [%s]->[%s]\n", old_ip4, new_ip4, old_ip6, new_ip6);
strncpy(mod_sofia_globals.guess_ip, new_ip4, sizeof(mod_sofia_globals.guess_ip));
snprintf(mod_sofia_globals.guess_ip, sizeof(mod_sofia_globals.guess_ip), "%s", new_ip4);
switch_mutex_lock(mod_sofia_globals.hash_mutex);
if (mod_sofia_globals.profile_hash) {

View File

@ -2412,7 +2412,7 @@ void sofia_reg_handle_sip_r_register(int status,
if (de && de->data && de->data->e_msg) {
if (!zstr_buf(gateway->register_network_ip)) {
strncpy(oregister_network_ip, gateway->register_network_ip, sizeof(oregister_network_ip) - 1);
snprintf(oregister_network_ip, sizeof(oregister_network_ip), "%s", gateway->register_network_ip);
}
sofia_glue_get_addr(de->data->e_msg, network_ip, sizeof(network_ip), &gateway->register_network_port);
if (!zstr_buf(network_ip)) {

View File

@ -56,9 +56,6 @@ extern "C" {
#ifndef strncasecmp
#define strncasecmp _strnicmp
#endif
#if _MSC_VER < 1900
#define snprintf _snprintf
#endif
#ifdef _WIN64
#define WS_SSIZE_T __int64
#elif _MSC_VER >= 1400

View File

@ -40,9 +40,6 @@
#ifndef strncasecmp
#define strncasecmp _strnicmp
#endif
#if _MSC_VER < 1900
#define snprintf _snprintf
#endif
#ifdef _WIN64
#define WS_SSIZE_T __int64
#elif _MSC_VER >= 1400

View File

@ -333,8 +333,7 @@ static size_t header_callback(char *buffer, size_t size, size_t nitems, void *us
int len = strlen(buffer);
char buf[1024];
if(len > 2 && len < 1024) {
strncpy(buf, buffer, len-2);
buf[len-2] = '\0';
snprintf(buf, sizeof(buf), "%s", buffer);
switch_event_add_header_string(event, SWITCH_STACK_PUSH | SWITCH_STACK_BOTTOM, "Reply-Headers", buf);
}
return nitems * size;

View File

@ -252,7 +252,7 @@ static switch_status_t ja_say_time(switch_core_session_t *session, char *tosay,
const char *tz = switch_channel_get_variable(channel, "timezone");
int mod_min;
char buffer[3];
char buffer[11];
if (say_args->type == SST_TIME_MEASUREMENT) {

View File

@ -13,9 +13,6 @@
#include <sys/socket.h>
#else
#pragma warning(disable:4996)
#if _MSC_VER < 1900
#define snprintf _snprintf
#endif
#endif
#include <string.h>
#include <string.h>

View File

@ -39,7 +39,7 @@ static void db_pick_path(const char *dbname, char *buf, switch_size_t size)
{
memset(buf, 0, size);
if (switch_is_file_path(dbname)) {
strncpy(buf, dbname, size);
strncpy(buf, dbname, size-1);
} else {
switch_snprintf(buf, size, "%s%s%s.db", SWITCH_GLOBAL_dirs.db_dir, SWITCH_PATH_SEPARATOR, dbname);
}

View File

@ -11921,7 +11921,7 @@ SWITCH_DECLARE(void) switch_core_media_patch_sdp(switch_core_session_t *session)
memcpy(q, strchr(a_engine->adv_sdp_ip, ':') ? "6 " : "4 ", 2);
p +=2;
q +=2;
strncpy(q, a_engine->adv_sdp_ip, strlen(a_engine->adv_sdp_ip));
snprintf(q, qe - q, "%s", a_engine->adv_sdp_ip);
q += strlen(a_engine->adv_sdp_ip);
while (p && *p && ((*p >= '0' && *p <= '9') || *p == '.' || *p == ':' || (*p >= 'A' && *p <= 'F') || (*p >= 'a' && *p <= 'f'))) {
@ -11967,7 +11967,7 @@ SWITCH_DECLARE(void) switch_core_media_patch_sdp(switch_core_session_t *session)
snprintf(o_line, sizeof(o_line), "o=%s %010u %010u IN %s %s\r\n",
smh->mparams->sdp_username, smh->owner_id, smh->session_id, family, smh->mparams->sipip);
strncpy(q, o_line, strlen(o_line));
snprintf(q, qe-q, "%s", o_line);
q += strlen(o_line) - 1;
}
@ -11988,8 +11988,8 @@ SWITCH_DECLARE(void) switch_core_media_patch_sdp(switch_core_session_t *session)
p += len;
snprintf(s_line, sizeof(s_line), "s=%s\r\n", smh->mparams->sdp_username);
snprintf(q, qe-q, "%s", s_line);
strncpy(q, s_line, strlen(s_line));
q += strlen(s_line) - 1;
}
@ -12012,7 +12012,7 @@ SWITCH_DECLARE(void) switch_core_media_patch_sdp(switch_core_session_t *session)
}
strncpy(q, port_buf, strlen(port_buf));
snprintf(q, qe - q, "%s", port_buf);
q += strlen(port_buf);
if (q >= qe) {
@ -12074,7 +12074,7 @@ SWITCH_DECLARE(void) switch_core_media_patch_sdp(switch_core_session_t *session)
goto end;
}
strncpy(q, vport_buf, strlen(vport_buf));
snprintf(q, qe-q, "%s", vport_buf);
q += strlen(vport_buf);
if (q >= qe) {
@ -12137,7 +12137,7 @@ SWITCH_DECLARE(void) switch_core_media_patch_sdp(switch_core_session_t *session)
goto end;
}
strncpy(q, tport_buf, strlen(tport_buf));
snprintf(q, qe-q, "%s", tport_buf);
q += strlen(tport_buf);
if (q >= qe) {

View File

@ -4160,7 +4160,7 @@ SWITCH_DECLARE(void) switch_cache_db_status(switch_stream_handle_t *stream)
}
}
if (i == 3) {
strncpy(cleankey_str, dbh->name, strlen(dbh->name));
snprintf(cleankey_str, sizeof(cleankey_str), "%s", dbh->name);
}
count++;

View File

@ -2711,11 +2711,11 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text_handle(switch_core_session
memset(tmp, 0, mylen);
tp = tmp;
for (p = text; p && *p; p++) {
if (*p == '*') {
strncat(tp, star, starlen);
if (*p == '*' ) {
snprintf(tp + strlen(tp), sizeof(tp) - strlen(tp), "%s", star);
tp += starlen;
} else if (*p == '#') {
strncat(tp, pound, poundlen);
snprintf(tp + strlen(tp), sizeof(tp) - strlen(tp), "%s", pound);
tp += poundlen;
} else {
*tp++ = *p;

View File

@ -157,7 +157,7 @@ static switch_status_t switch_loadable_module_process(char *key, switch_loadable
{
switch_event_t *event;
int *event_num = NULL;
char str_event_num[10];
char str_event_num[12];
void *val;
int added = 0;

View File

@ -427,7 +427,7 @@ SWITCH_DECLARE(void) switch_nat_init(switch_memory_pool_t *pool, switch_bool_t m
switch_core_set_variable("nat_public_addr", nat_globals.pub_addr);
switch_core_set_variable("nat_private_addr", nat_globals.pvt_addr);
switch_core_set_variable("nat_type", nat_globals.nat_type == SWITCH_NAT_TYPE_PMP ? "pmp" : "upnp");
strncpy(nat_globals.nat_type_str, nat_globals.nat_type == SWITCH_NAT_TYPE_PMP ? "pmp" : "upnp", sizeof(nat_globals.nat_type_str) - 1);
strncpy(nat_globals.nat_type_str, nat_globals.nat_type == SWITCH_NAT_TYPE_PMP ? "pmp" : "upnp", sizeof(nat_globals.nat_type_str));
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "NAT detected type: %s, ExtIP: '%s'\n",
nat_globals.nat_type == SWITCH_NAT_TYPE_PMP ? "pmp" : "upnp", nat_globals.pub_addr);