mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-23 14:44:28 +00:00
there is no reason to define our own 'maximum path length' when the POSIX headers already define one for us
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@33351 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -32,7 +32,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <limits.h>
|
|
||||||
|
|
||||||
#include "asterisk/frame.h"
|
#include "asterisk/frame.h"
|
||||||
#include "asterisk/channel.h"
|
#include "asterisk/channel.h"
|
||||||
|
@@ -92,12 +92,12 @@ struct ast_call_followme {
|
|||||||
unsigned int active; /*!< Profile is active (1), or disabled (0). */
|
unsigned int active; /*!< Profile is active (1), or disabled (0). */
|
||||||
char takecall[20]; /*!< Digit mapping to take a call */
|
char takecall[20]; /*!< Digit mapping to take a call */
|
||||||
char nextindp[20]; /*!< Digit mapping to decline a call */
|
char nextindp[20]; /*!< Digit mapping to decline a call */
|
||||||
char callfromprompt[AST_CONFIG_MAX_PATH];
|
char callfromprompt[PATH_MAX];
|
||||||
char norecordingprompt[AST_CONFIG_MAX_PATH];
|
char norecordingprompt[PATH_MAX];
|
||||||
char optionsprompt[AST_CONFIG_MAX_PATH];
|
char optionsprompt[PATH_MAX];
|
||||||
char plsholdprompt[AST_CONFIG_MAX_PATH];
|
char plsholdprompt[PATH_MAX];
|
||||||
char statusprompt[AST_CONFIG_MAX_PATH];
|
char statusprompt[PATH_MAX];
|
||||||
char sorryprompt[AST_CONFIG_MAX_PATH];
|
char sorryprompt[PATH_MAX];
|
||||||
|
|
||||||
AST_LIST_HEAD_NOLOCK(numbers, number) numbers; /*!< Head of the list of follow-me numbers */
|
AST_LIST_HEAD_NOLOCK(numbers, number) numbers; /*!< Head of the list of follow-me numbers */
|
||||||
AST_LIST_HEAD_NOLOCK(blnumbers, number) blnumbers; /*!< Head of the list of black-listed numbers */
|
AST_LIST_HEAD_NOLOCK(blnumbers, number) blnumbers; /*!< Head of the list of black-listed numbers */
|
||||||
@@ -115,12 +115,12 @@ struct fm_args {
|
|||||||
struct ast_channel *outbound;
|
struct ast_channel *outbound;
|
||||||
char takecall[20]; /*!< Digit mapping to take a call */
|
char takecall[20]; /*!< Digit mapping to take a call */
|
||||||
char nextindp[20]; /*!< Digit mapping to decline a call */
|
char nextindp[20]; /*!< Digit mapping to decline a call */
|
||||||
char callfromprompt[AST_CONFIG_MAX_PATH];
|
char callfromprompt[PATH_MAX];
|
||||||
char norecordingprompt[AST_CONFIG_MAX_PATH];
|
char norecordingprompt[PATH_MAX];
|
||||||
char optionsprompt[AST_CONFIG_MAX_PATH];
|
char optionsprompt[PATH_MAX];
|
||||||
char plsholdprompt[AST_CONFIG_MAX_PATH];
|
char plsholdprompt[PATH_MAX];
|
||||||
char statusprompt[AST_CONFIG_MAX_PATH];
|
char statusprompt[PATH_MAX];
|
||||||
char sorryprompt[AST_CONFIG_MAX_PATH];
|
char sorryprompt[PATH_MAX];
|
||||||
struct ast_flags followmeflags;
|
struct ast_flags followmeflags;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -156,12 +156,12 @@ static int featuredigittimeout = 5000; /*!< Feature Digit Timeout */
|
|||||||
static const char *defaultmoh = "default"; /*!< Default Music-On-Hold Class */
|
static const char *defaultmoh = "default"; /*!< Default Music-On-Hold Class */
|
||||||
|
|
||||||
static char takecall[20] = "1", nextindp[20] = "2";
|
static char takecall[20] = "1", nextindp[20] = "2";
|
||||||
static char callfromprompt[AST_CONFIG_MAX_PATH] = "followme/call-from";
|
static char callfromprompt[PATH_MAX] = "followme/call-from";
|
||||||
static char norecordingprompt[AST_CONFIG_MAX_PATH] = "followme/no-recording";
|
static char norecordingprompt[PATH_MAX] = "followme/no-recording";
|
||||||
static char optionsprompt[AST_CONFIG_MAX_PATH] = "followme/followme-options";
|
static char optionsprompt[PATH_MAX] = "followme/followme-options";
|
||||||
static char plsholdprompt[AST_CONFIG_MAX_PATH] = "followme/pls-hold-while-try";
|
static char plsholdprompt[PATH_MAX] = "followme/pls-hold-while-try";
|
||||||
static char statusprompt[AST_CONFIG_MAX_PATH] = "followme/followme-status";
|
static char statusprompt[PATH_MAX] = "followme/followme-status";
|
||||||
static char sorryprompt[AST_CONFIG_MAX_PATH] = "followme/followme-sorry";
|
static char sorryprompt[PATH_MAX] = "followme/followme-sorry";
|
||||||
|
|
||||||
|
|
||||||
static AST_LIST_HEAD_STATIC(followmes, ast_call_followme);
|
static AST_LIST_HEAD_STATIC(followmes, ast_call_followme);
|
||||||
|
@@ -309,7 +309,7 @@ static char odbc_table[80];
|
|||||||
#define DELETE(a,b,c) (vm_delete(c))
|
#define DELETE(a,b,c) (vm_delete(c))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static char VM_SPOOL_DIR[AST_CONFIG_MAX_PATH];
|
static char VM_SPOOL_DIR[PATH_MAX];
|
||||||
|
|
||||||
static char ext_pass_cmd[128];
|
static char ext_pass_cmd[128];
|
||||||
|
|
||||||
@@ -651,8 +651,8 @@ static void vm_change_password(struct ast_vm_user *vmu, const char *newpassword)
|
|||||||
char inbuf[256];
|
char inbuf[256];
|
||||||
char orig[256];
|
char orig[256];
|
||||||
char currcontext[256] ="";
|
char currcontext[256] ="";
|
||||||
char tmpin[AST_CONFIG_MAX_PATH];
|
char tmpin[PATH_MAX];
|
||||||
char tmpout[AST_CONFIG_MAX_PATH];
|
char tmpout[PATH_MAX];
|
||||||
struct stat statbuf;
|
struct stat statbuf;
|
||||||
|
|
||||||
if (!change_password_realtime(vmu, newpassword))
|
if (!change_password_realtime(vmu, newpassword))
|
||||||
|
40
asterisk.c
40
asterisk.c
@@ -199,26 +199,26 @@ static int ast_el_add_history(char *);
|
|||||||
static int ast_el_read_history(char *);
|
static int ast_el_read_history(char *);
|
||||||
static int ast_el_write_history(char *);
|
static int ast_el_write_history(char *);
|
||||||
|
|
||||||
char ast_config_AST_CONFIG_DIR[AST_CONFIG_MAX_PATH];
|
char ast_config_AST_CONFIG_DIR[PATH_MAX];
|
||||||
char ast_config_AST_CONFIG_FILE[AST_CONFIG_MAX_PATH];
|
char ast_config_AST_CONFIG_FILE[PATH_MAX];
|
||||||
char ast_config_AST_MODULE_DIR[AST_CONFIG_MAX_PATH];
|
char ast_config_AST_MODULE_DIR[PATH_MAX];
|
||||||
char ast_config_AST_SPOOL_DIR[AST_CONFIG_MAX_PATH];
|
char ast_config_AST_SPOOL_DIR[PATH_MAX];
|
||||||
char ast_config_AST_MONITOR_DIR[AST_CONFIG_MAX_PATH];
|
char ast_config_AST_MONITOR_DIR[PATH_MAX];
|
||||||
char ast_config_AST_VAR_DIR[AST_CONFIG_MAX_PATH];
|
char ast_config_AST_VAR_DIR[PATH_MAX];
|
||||||
char ast_config_AST_DATA_DIR[AST_CONFIG_MAX_PATH];
|
char ast_config_AST_DATA_DIR[PATH_MAX];
|
||||||
char ast_config_AST_LOG_DIR[AST_CONFIG_MAX_PATH];
|
char ast_config_AST_LOG_DIR[PATH_MAX];
|
||||||
char ast_config_AST_AGI_DIR[AST_CONFIG_MAX_PATH];
|
char ast_config_AST_AGI_DIR[PATH_MAX];
|
||||||
char ast_config_AST_DB[AST_CONFIG_MAX_PATH];
|
char ast_config_AST_DB[PATH_MAX];
|
||||||
char ast_config_AST_KEY_DIR[AST_CONFIG_MAX_PATH];
|
char ast_config_AST_KEY_DIR[PATH_MAX];
|
||||||
char ast_config_AST_PID[AST_CONFIG_MAX_PATH];
|
char ast_config_AST_PID[PATH_MAX];
|
||||||
char ast_config_AST_SOCKET[AST_CONFIG_MAX_PATH];
|
char ast_config_AST_SOCKET[PATH_MAX];
|
||||||
char ast_config_AST_RUN_DIR[AST_CONFIG_MAX_PATH];
|
char ast_config_AST_RUN_DIR[PATH_MAX];
|
||||||
char ast_config_AST_RUN_USER[AST_CONFIG_MAX_PATH];
|
char ast_config_AST_RUN_USER[PATH_MAX];
|
||||||
char ast_config_AST_RUN_GROUP[AST_CONFIG_MAX_PATH];
|
char ast_config_AST_RUN_GROUP[PATH_MAX];
|
||||||
char ast_config_AST_CTL_PERMISSIONS[AST_CONFIG_MAX_PATH];
|
char ast_config_AST_CTL_PERMISSIONS[PATH_MAX];
|
||||||
char ast_config_AST_CTL_OWNER[AST_CONFIG_MAX_PATH] = "\0";
|
char ast_config_AST_CTL_OWNER[PATH_MAX] = "\0";
|
||||||
char ast_config_AST_CTL_GROUP[AST_CONFIG_MAX_PATH] = "\0";
|
char ast_config_AST_CTL_GROUP[PATH_MAX] = "\0";
|
||||||
char ast_config_AST_CTL[AST_CONFIG_MAX_PATH] = "asterisk.ctl";
|
char ast_config_AST_CTL[PATH_MAX] = "asterisk.ctl";
|
||||||
char ast_config_AST_SYSTEM_NAME[20] = "";
|
char ast_config_AST_SYSTEM_NAME[20] = "";
|
||||||
|
|
||||||
extern const char *ast_build_hostname;
|
extern const char *ast_build_hostname;
|
||||||
|
@@ -261,7 +261,7 @@ static int build_csv_record(char *buf, size_t bufsize, struct ast_cdr *cdr)
|
|||||||
|
|
||||||
static int writefile(char *s, char *acc)
|
static int writefile(char *s, char *acc)
|
||||||
{
|
{
|
||||||
char tmp[AST_CONFIG_MAX_PATH];
|
char tmp[PATH_MAX];
|
||||||
FILE *f;
|
FILE *f;
|
||||||
if (strchr(acc, '/') || (acc[0] == '.')) {
|
if (strchr(acc, '/') || (acc[0] == '.')) {
|
||||||
ast_log(LOG_WARNING, "Account code '%s' insecure for writing file\n", acc);
|
ast_log(LOG_WARNING, "Account code '%s' insecure for writing file\n", acc);
|
||||||
@@ -282,7 +282,7 @@ static int csv_log(struct ast_cdr *cdr)
|
|||||||
{
|
{
|
||||||
/* Make sure we have a big enough buf */
|
/* Make sure we have a big enough buf */
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
char csvmaster[AST_CONFIG_MAX_PATH];
|
char csvmaster[PATH_MAX];
|
||||||
snprintf(csvmaster, sizeof(csvmaster),"%s/%s/%s", ast_config_AST_LOG_DIR, CSV_LOG_DIR, CSV_MASTER);
|
snprintf(csvmaster, sizeof(csvmaster),"%s/%s/%s", ast_config_AST_LOG_DIR, CSV_LOG_DIR, CSV_MASTER);
|
||||||
#if 0
|
#if 0
|
||||||
printf("[CDR] %s ('%s' -> '%s') Dur: %ds Bill: %ds Disp: %s Flags: %s Account: [%s]\n", cdr->channel, cdr->src, cdr->dst, cdr->duration, cdr->billsec, ast_cdr_disp2str(cdr->disposition), ast_cdr_flags2str(cdr->amaflags), cdr->accountcode);
|
printf("[CDR] %s ('%s' -> '%s') Dur: %ds Bill: %ds Disp: %s Flags: %s Account: [%s]\n", cdr->channel, cdr->src, cdr->dst, cdr->duration, cdr->billsec, ast_cdr_disp2str(cdr->disposition), ast_cdr_flags2str(cdr->amaflags), cdr->accountcode);
|
||||||
|
@@ -63,7 +63,7 @@ static char *name = "cdr-custom";
|
|||||||
|
|
||||||
static FILE *mf = NULL;
|
static FILE *mf = NULL;
|
||||||
|
|
||||||
static char master[AST_CONFIG_MAX_PATH];
|
static char master[PATH_MAX];
|
||||||
static char format[1024]="";
|
static char format[1024]="";
|
||||||
|
|
||||||
static int load_config(int reload)
|
static int load_config(int reload)
|
||||||
|
@@ -88,7 +88,7 @@ static char *desc = "RADIUS CDR Backend";
|
|||||||
static char *name = "radius";
|
static char *name = "radius";
|
||||||
static char *cdr_config = "cdr.conf";
|
static char *cdr_config = "cdr.conf";
|
||||||
|
|
||||||
static char radiuscfg[AST_CONFIG_MAX_PATH] = "/etc/radiusclient-ng/radiusclient.conf";
|
static char radiuscfg[PATH_MAX] = "/etc/radiusclient-ng/radiusclient.conf";
|
||||||
|
|
||||||
static struct ast_flags global_flags = { RADIUS_FLAG_USEGMTIME | RADIUS_FLAG_LOGUNIQUEID | RADIUS_FLAG_LOGUSERFIELD };
|
static struct ast_flags global_flags = { RADIUS_FLAG_USEGMTIME | RADIUS_FLAG_LOGUNIQUEID | RADIUS_FLAG_LOGUSERFIELD };
|
||||||
|
|
||||||
|
@@ -22,32 +22,32 @@
|
|||||||
|
|
||||||
#include "asterisk/compat.h"
|
#include "asterisk/compat.h"
|
||||||
|
|
||||||
|
#include <limits.h>
|
||||||
|
|
||||||
#define DEFAULT_LANGUAGE "en"
|
#define DEFAULT_LANGUAGE "en"
|
||||||
|
|
||||||
#define DEFAULT_SAMPLE_RATE 8000
|
#define DEFAULT_SAMPLE_RATE 8000
|
||||||
#define DEFAULT_SAMPLES_PER_MS ((DEFAULT_SAMPLE_RATE)/1000)
|
#define DEFAULT_SAMPLES_PER_MS ((DEFAULT_SAMPLE_RATE)/1000)
|
||||||
|
|
||||||
#define AST_CONFIG_MAX_PATH 255
|
|
||||||
|
|
||||||
/* provided in asterisk.c */
|
/* provided in asterisk.c */
|
||||||
extern char ast_config_AST_CONFIG_DIR[AST_CONFIG_MAX_PATH];
|
extern char ast_config_AST_CONFIG_DIR[PATH_MAX];
|
||||||
extern char ast_config_AST_CONFIG_FILE[AST_CONFIG_MAX_PATH];
|
extern char ast_config_AST_CONFIG_FILE[PATH_MAX];
|
||||||
extern char ast_config_AST_MODULE_DIR[AST_CONFIG_MAX_PATH];
|
extern char ast_config_AST_MODULE_DIR[PATH_MAX];
|
||||||
extern char ast_config_AST_SPOOL_DIR[AST_CONFIG_MAX_PATH];
|
extern char ast_config_AST_SPOOL_DIR[PATH_MAX];
|
||||||
extern char ast_config_AST_MONITOR_DIR[AST_CONFIG_MAX_PATH];
|
extern char ast_config_AST_MONITOR_DIR[PATH_MAX];
|
||||||
extern char ast_config_AST_VAR_DIR[AST_CONFIG_MAX_PATH];
|
extern char ast_config_AST_VAR_DIR[PATH_MAX];
|
||||||
extern char ast_config_AST_DATA_DIR[AST_CONFIG_MAX_PATH];
|
extern char ast_config_AST_DATA_DIR[PATH_MAX];
|
||||||
extern char ast_config_AST_LOG_DIR[AST_CONFIG_MAX_PATH];
|
extern char ast_config_AST_LOG_DIR[PATH_MAX];
|
||||||
extern char ast_config_AST_AGI_DIR[AST_CONFIG_MAX_PATH];
|
extern char ast_config_AST_AGI_DIR[PATH_MAX];
|
||||||
extern char ast_config_AST_DB[AST_CONFIG_MAX_PATH];
|
extern char ast_config_AST_DB[PATH_MAX];
|
||||||
extern char ast_config_AST_KEY_DIR[AST_CONFIG_MAX_PATH];
|
extern char ast_config_AST_KEY_DIR[PATH_MAX];
|
||||||
extern char ast_config_AST_PID[AST_CONFIG_MAX_PATH];
|
extern char ast_config_AST_PID[PATH_MAX];
|
||||||
extern char ast_config_AST_SOCKET[AST_CONFIG_MAX_PATH];
|
extern char ast_config_AST_SOCKET[PATH_MAX];
|
||||||
extern char ast_config_AST_RUN_DIR[AST_CONFIG_MAX_PATH];
|
extern char ast_config_AST_RUN_DIR[PATH_MAX];
|
||||||
extern char ast_config_AST_CTL_PERMISSIONS[AST_CONFIG_MAX_PATH];
|
extern char ast_config_AST_CTL_PERMISSIONS[PATH_MAX];
|
||||||
extern char ast_config_AST_CTL_OWNER[AST_CONFIG_MAX_PATH];
|
extern char ast_config_AST_CTL_OWNER[PATH_MAX];
|
||||||
extern char ast_config_AST_CTL_GROUP[AST_CONFIG_MAX_PATH];
|
extern char ast_config_AST_CTL_GROUP[PATH_MAX];
|
||||||
extern char ast_config_AST_CTL[AST_CONFIG_MAX_PATH];
|
extern char ast_config_AST_CTL[PATH_MAX];
|
||||||
extern char ast_config_AST_SYSTEM_NAME[20];
|
extern char ast_config_AST_SYSTEM_NAME[20];
|
||||||
|
|
||||||
int ast_set_priority(int); /*!< Provided by asterisk.c */
|
int ast_set_priority(int); /*!< Provided by asterisk.c */
|
||||||
|
4
logger.c
4
logger.c
@@ -378,8 +378,8 @@ void ast_queue_log(const char *queuename, const char *callid, const char *agent,
|
|||||||
|
|
||||||
int reload_logger(int rotate)
|
int reload_logger(int rotate)
|
||||||
{
|
{
|
||||||
char old[AST_CONFIG_MAX_PATH] = "";
|
char old[PATH_MAX] = "";
|
||||||
char new[AST_CONFIG_MAX_PATH];
|
char new[PATH_MAX];
|
||||||
int event_rotate = rotate, queue_rotate = rotate;
|
int event_rotate = rotate, queue_rotate = rotate;
|
||||||
struct logchannel *f;
|
struct logchannel *f;
|
||||||
FILE *myf;
|
FILE *myf;
|
||||||
|
Reference in New Issue
Block a user