mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-09 11:28:25 +00:00
automerge commit
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2-netsec@49456 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -243,10 +243,10 @@ struct vm_zone {
|
|||||||
struct vm_state {
|
struct vm_state {
|
||||||
char curbox[80];
|
char curbox[80];
|
||||||
char username[80];
|
char username[80];
|
||||||
char curdir[256];
|
char curdir[PATH_MAX];
|
||||||
char vmbox[256];
|
char vmbox[PATH_MAX];
|
||||||
char fn[256];
|
char fn[PATH_MAX];
|
||||||
char fn2[256];
|
char fn2[PATH_MAX];
|
||||||
int *deleted;
|
int *deleted;
|
||||||
int *heard;
|
int *heard;
|
||||||
int curmsg;
|
int curmsg;
|
||||||
@@ -839,7 +839,7 @@ static int retrieve_file(char *dir, int msgnum)
|
|||||||
void *fdm=NULL;
|
void *fdm=NULL;
|
||||||
SQLSMALLINT colcount=0;
|
SQLSMALLINT colcount=0;
|
||||||
SQLHSTMT stmt;
|
SQLHSTMT stmt;
|
||||||
char sql[256];
|
char sql[PATH_MAX];
|
||||||
char fmt[80]="";
|
char fmt[80]="";
|
||||||
char *c;
|
char *c;
|
||||||
char coltitle[256];
|
char coltitle[256];
|
||||||
@@ -850,8 +850,8 @@ static int retrieve_file(char *dir, int msgnum)
|
|||||||
SQLULEN colsize;
|
SQLULEN colsize;
|
||||||
FILE *f=NULL;
|
FILE *f=NULL;
|
||||||
char rowdata[80];
|
char rowdata[80];
|
||||||
char fn[256];
|
char fn[PATH_MAX];
|
||||||
char full_fn[256];
|
char full_fn[PATH_MAX];
|
||||||
char msgnums[80];
|
char msgnums[80];
|
||||||
|
|
||||||
odbc_obj *obj;
|
odbc_obj *obj;
|
||||||
@@ -986,8 +986,8 @@ yuck:
|
|||||||
|
|
||||||
static int remove_file(char *dir, int msgnum)
|
static int remove_file(char *dir, int msgnum)
|
||||||
{
|
{
|
||||||
char fn[256];
|
char fn[PATH_MAX];
|
||||||
char full_fn[256];
|
char full_fn[PATH_MAX];
|
||||||
char msgnums[80];
|
char msgnums[80];
|
||||||
|
|
||||||
if (msgnum > -1) {
|
if (msgnum > -1) {
|
||||||
@@ -1006,7 +1006,7 @@ static int last_message_index(struct ast_vm_user *vmu, char *dir)
|
|||||||
int x = 0;
|
int x = 0;
|
||||||
int res;
|
int res;
|
||||||
SQLHSTMT stmt;
|
SQLHSTMT stmt;
|
||||||
char sql[256];
|
char sql[PATH_MAX];
|
||||||
char rowdata[20];
|
char rowdata[20];
|
||||||
|
|
||||||
odbc_obj *obj;
|
odbc_obj *obj;
|
||||||
@@ -1057,7 +1057,7 @@ static int message_exists(char *dir, int msgnum)
|
|||||||
int x = 0;
|
int x = 0;
|
||||||
int res;
|
int res;
|
||||||
SQLHSTMT stmt;
|
SQLHSTMT stmt;
|
||||||
char sql[256];
|
char sql[PATH_MAX];
|
||||||
char rowdata[20];
|
char rowdata[20];
|
||||||
char msgnums[20];
|
char msgnums[20];
|
||||||
|
|
||||||
@@ -1115,7 +1115,7 @@ static void delete_file(char *sdir, int smsg)
|
|||||||
{
|
{
|
||||||
int res;
|
int res;
|
||||||
SQLHSTMT stmt;
|
SQLHSTMT stmt;
|
||||||
char sql[256];
|
char sql[PATH_MAX];
|
||||||
char msgnums[20];
|
char msgnums[20];
|
||||||
|
|
||||||
odbc_obj *obj;
|
odbc_obj *obj;
|
||||||
@@ -1212,10 +1212,10 @@ static int store_file(char *dir, char *mailboxuser, char *mailboxcontext, int ms
|
|||||||
size_t fdlen = -1;
|
size_t fdlen = -1;
|
||||||
SQLHSTMT stmt;
|
SQLHSTMT stmt;
|
||||||
SQLINTEGER len;
|
SQLINTEGER len;
|
||||||
char sql[256];
|
char sql[PATH_MAX];
|
||||||
char msgnums[20];
|
char msgnums[20];
|
||||||
char fn[256];
|
char fn[PATH_MAX];
|
||||||
char full_fn[256];
|
char full_fn[PATH_MAX];
|
||||||
char fmt[80]="";
|
char fmt[80]="";
|
||||||
char *c;
|
char *c;
|
||||||
char *context="", *macrocontext="", *callerid="", *origtime="", *duration="";
|
char *context="", *macrocontext="", *callerid="", *origtime="", *duration="";
|
||||||
@@ -1331,7 +1331,7 @@ static void rename_file(char *sdir, int smsg, char *mailboxuser, char *mailboxco
|
|||||||
{
|
{
|
||||||
int res;
|
int res;
|
||||||
SQLHSTMT stmt;
|
SQLHSTMT stmt;
|
||||||
char sql[256];
|
char sql[PATH_MAX];
|
||||||
char msgnums[20];
|
char msgnums[20];
|
||||||
char msgnumd[20];
|
char msgnumd[20];
|
||||||
odbc_obj *obj;
|
odbc_obj *obj;
|
||||||
@@ -1408,8 +1408,8 @@ static int count_messages(struct ast_vm_user *vmu, char *dir)
|
|||||||
|
|
||||||
static void rename_file(char *sfn, char *dfn)
|
static void rename_file(char *sfn, char *dfn)
|
||||||
{
|
{
|
||||||
char stxt[256];
|
char stxt[PATH_MAX];
|
||||||
char dtxt[256];
|
char dtxt[PATH_MAX];
|
||||||
ast_filerename(sfn,dfn,NULL);
|
ast_filerename(sfn,dfn,NULL);
|
||||||
snprintf(stxt, sizeof(stxt), "%s.txt", sfn);
|
snprintf(stxt, sizeof(stxt), "%s.txt", sfn);
|
||||||
snprintf(dtxt, sizeof(dtxt), "%s.txt", dfn);
|
snprintf(dtxt, sizeof(dtxt), "%s.txt", dfn);
|
||||||
@@ -1468,7 +1468,7 @@ static int copy(char *infile, char *outfile)
|
|||||||
|
|
||||||
static void copy_file(char *frompath, char *topath)
|
static void copy_file(char *frompath, char *topath)
|
||||||
{
|
{
|
||||||
char frompath2[256],topath2[256];
|
char frompath2[PATH_MAX], topath2[PATH_MAX];
|
||||||
ast_filecopy(frompath, topath, NULL);
|
ast_filecopy(frompath, topath, NULL);
|
||||||
snprintf(frompath2, sizeof(frompath2), "%s.txt", frompath);
|
snprintf(frompath2, sizeof(frompath2), "%s.txt", frompath);
|
||||||
snprintf(topath2, sizeof(topath2), "%s.txt", topath);
|
snprintf(topath2, sizeof(topath2), "%s.txt", topath);
|
||||||
@@ -1481,7 +1481,7 @@ static void copy_file(char *frompath, char *topath)
|
|||||||
static int last_message_index(struct ast_vm_user *vmu, char *dir)
|
static int last_message_index(struct ast_vm_user *vmu, char *dir)
|
||||||
{
|
{
|
||||||
int x;
|
int x;
|
||||||
char fn[256];
|
char fn[PATH_MAX];
|
||||||
|
|
||||||
if (vm_lock_path(dir))
|
if (vm_lock_path(dir))
|
||||||
return ERROR_LOCK_PATH;
|
return ERROR_LOCK_PATH;
|
||||||
@@ -1660,10 +1660,10 @@ static int sendmail(char *srcemail, struct ast_vm_user *vmu, int msgnum, char *c
|
|||||||
char host[MAXHOSTNAMELEN] = "";
|
char host[MAXHOSTNAMELEN] = "";
|
||||||
char who[256];
|
char who[256];
|
||||||
char bound[256];
|
char bound[256];
|
||||||
char fname[256];
|
char fname[PATH_MAX];
|
||||||
char dur[256];
|
char dur[PATH_MAX];
|
||||||
char tmp[80] = "/tmp/astmail-XXXXXX";
|
char tmp[80] = "/tmp/astmail-XXXXXX";
|
||||||
char tmp2[256];
|
char tmp2[PATH_MAX];
|
||||||
time_t t;
|
time_t t;
|
||||||
struct tm tm;
|
struct tm tm;
|
||||||
struct vm_zone *the_zone = NULL;
|
struct vm_zone *the_zone = NULL;
|
||||||
@@ -1821,9 +1821,9 @@ static int sendpage(char *srcemail, char *pager, int msgnum, char *context, char
|
|||||||
char date[256];
|
char date[256];
|
||||||
char host[MAXHOSTNAMELEN] = "";
|
char host[MAXHOSTNAMELEN] = "";
|
||||||
char who[256];
|
char who[256];
|
||||||
char dur[256];
|
char dur[PATH_MAX];
|
||||||
char tmp[80] = "/tmp/astmail-XXXXXX";
|
char tmp[80] = "/tmp/astmail-XXXXXX";
|
||||||
char tmp2[256];
|
char tmp2[PATH_MAX];
|
||||||
time_t t;
|
time_t t;
|
||||||
struct tm tm;
|
struct tm tm;
|
||||||
struct vm_zone *the_zone = NULL;
|
struct vm_zone *the_zone = NULL;
|
||||||
@@ -1942,12 +1942,12 @@ static int get_date(char *s, int len)
|
|||||||
static int invent_message(struct ast_channel *chan, char *context, char *ext, int busy, char *ecodes)
|
static int invent_message(struct ast_channel *chan, char *context, char *ext, int busy, char *ecodes)
|
||||||
{
|
{
|
||||||
int res;
|
int res;
|
||||||
char fn[256];
|
char fn[PATH_MAX];
|
||||||
char dest[256];
|
char dest[PATH_MAX];
|
||||||
|
|
||||||
snprintf(fn, sizeof(fn), "%s%s/%s/greet", VM_SPOOL_DIR, context, ext);
|
snprintf(fn, sizeof(fn), "%s%s/%s/greet", VM_SPOOL_DIR, context, ext);
|
||||||
|
|
||||||
if (!(res = create_dirpath(dest,256,context,ext,"greet"))) {
|
if (!(res = create_dirpath(dest, sizeof(dest), context, ext, "greet"))) {
|
||||||
ast_log(LOG_WARNING, "Failed to make directory(%s)\n", fn);
|
ast_log(LOG_WARNING, "Failed to make directory(%s)\n", fn);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -2032,9 +2032,9 @@ static int messagecount(const char *mailbox, int *newmsgs, int *oldmsgs)
|
|||||||
int x = -1;
|
int x = -1;
|
||||||
int res;
|
int res;
|
||||||
SQLHSTMT stmt;
|
SQLHSTMT stmt;
|
||||||
char sql[256];
|
char sql[PATH_MAX];
|
||||||
char rowdata[20];
|
char rowdata[20];
|
||||||
char tmp[256]="";
|
char tmp[PATH_MAX] = "";
|
||||||
char *context;
|
char *context;
|
||||||
|
|
||||||
if (newmsgs)
|
if (newmsgs)
|
||||||
@@ -2136,9 +2136,9 @@ static int has_voicemail(const char *mailbox, const char *folder)
|
|||||||
int nummsgs = 0;
|
int nummsgs = 0;
|
||||||
int res;
|
int res;
|
||||||
SQLHSTMT stmt;
|
SQLHSTMT stmt;
|
||||||
char sql[256];
|
char sql[PATH_MAX];
|
||||||
char rowdata[20];
|
char rowdata[20];
|
||||||
char tmp[256]="";
|
char tmp[PATH_MAX] = "";
|
||||||
char *context;
|
char *context;
|
||||||
if (!folder)
|
if (!folder)
|
||||||
folder = "INBOX";
|
folder = "INBOX";
|
||||||
@@ -2206,8 +2206,8 @@ static int has_voicemail(const char *mailbox, const char *folder)
|
|||||||
{
|
{
|
||||||
DIR *dir;
|
DIR *dir;
|
||||||
struct dirent *de;
|
struct dirent *de;
|
||||||
char fn[256];
|
char fn[PATH_MAX];
|
||||||
char tmp[256]="";
|
char tmp[PATH_MAX] = "";
|
||||||
char *mb, *cur;
|
char *mb, *cur;
|
||||||
char *context;
|
char *context;
|
||||||
int ret;
|
int ret;
|
||||||
@@ -2254,8 +2254,8 @@ static int messagecount(const char *mailbox, int *newmsgs, int *oldmsgs)
|
|||||||
{
|
{
|
||||||
DIR *dir;
|
DIR *dir;
|
||||||
struct dirent *de;
|
struct dirent *de;
|
||||||
char fn[256];
|
char fn[PATH_MAX];
|
||||||
char tmp[256]="";
|
char tmp[PATH_MAX] = "";
|
||||||
char *mb, *cur;
|
char *mb, *cur;
|
||||||
char *context;
|
char *context;
|
||||||
int ret;
|
int ret;
|
||||||
@@ -2327,7 +2327,7 @@ static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu,
|
|||||||
|
|
||||||
static int copy_message(struct ast_channel *chan, struct ast_vm_user *vmu, int imbox, int msgnum, long duration, struct ast_vm_user *recip, char *fmt)
|
static int copy_message(struct ast_channel *chan, struct ast_vm_user *vmu, int imbox, int msgnum, long duration, struct ast_vm_user *recip, char *fmt)
|
||||||
{
|
{
|
||||||
char fromdir[256], todir[256], frompath[256], topath[256];
|
char fromdir[PATH_MAX], todir[PATH_MAX], frompath[PATH_MAX], topath[PATH_MAX];
|
||||||
char *frombox = mbox(imbox);
|
char *frombox = mbox(imbox);
|
||||||
int recipmsgnum;
|
int recipmsgnum;
|
||||||
|
|
||||||
@@ -2388,7 +2388,7 @@ struct leave_vm_options {
|
|||||||
|
|
||||||
static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_options *options)
|
static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_options *options)
|
||||||
{
|
{
|
||||||
char txtfile[256], tmptxtfile[256];
|
char txtfile[PATH_MAX], tmptxtfile[PATH_MAX];
|
||||||
char callerid[256];
|
char callerid[256];
|
||||||
FILE *txt;
|
FILE *txt;
|
||||||
int res = 0, txtdes;
|
int res = 0, txtdes;
|
||||||
@@ -2398,11 +2398,11 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
|
|||||||
int ousemacro = 0;
|
int ousemacro = 0;
|
||||||
int ouseexten = 0;
|
int ouseexten = 0;
|
||||||
char date[256];
|
char date[256];
|
||||||
char dir[256], tmpdir[260];
|
char dir[PATH_MAX], tmpdir[PATH_MAX];
|
||||||
char dest[256];
|
char dest[PATH_MAX];
|
||||||
char fn[256];
|
char fn[PATH_MAX];
|
||||||
char prefile[256]="";
|
char prefile[PATH_MAX] = "";
|
||||||
char tempfile[256]="";
|
char tempfile[PATH_MAX] = "";
|
||||||
char ext_context[256] = "";
|
char ext_context[256] = "";
|
||||||
char fmt[80];
|
char fmt[80];
|
||||||
char *context;
|
char *context;
|
||||||
@@ -2712,8 +2712,8 @@ static int resequence_mailbox(struct ast_vm_user *vmu, char *dir)
|
|||||||
/* we know max messages, so stop process when number is hit */
|
/* we know max messages, so stop process when number is hit */
|
||||||
|
|
||||||
int x,dest;
|
int x,dest;
|
||||||
char sfn[256];
|
char sfn[PATH_MAX];
|
||||||
char dfn[256];
|
char dfn[PATH_MAX];
|
||||||
|
|
||||||
if (vm_lock_path(dir))
|
if (vm_lock_path(dir))
|
||||||
return ERROR_LOCK_PATH;
|
return ERROR_LOCK_PATH;
|
||||||
@@ -2745,9 +2745,9 @@ static int say_and_wait(struct ast_channel *chan, int num, char *language)
|
|||||||
|
|
||||||
static int save_to_folder(struct ast_vm_user *vmu, char *dir, int msg, char *context, char *username, int box)
|
static int save_to_folder(struct ast_vm_user *vmu, char *dir, int msg, char *context, char *username, int box)
|
||||||
{
|
{
|
||||||
char sfn[256];
|
char sfn[PATH_MAX];
|
||||||
char dfn[256];
|
char dfn[PATH_MAX];
|
||||||
char ddir[256];
|
char ddir[PATH_MAX];
|
||||||
char *dbox = mbox(box);
|
char *dbox = mbox(box);
|
||||||
int x;
|
int x;
|
||||||
make_file(sfn, sizeof(sfn), dir, msg);
|
make_file(sfn, sizeof(sfn), dir, msg);
|
||||||
@@ -3009,7 +3009,7 @@ static void adsi_message(struct ast_channel *chan, struct vm_state *vms)
|
|||||||
int bytes=0;
|
int bytes=0;
|
||||||
unsigned char buf[256];
|
unsigned char buf[256];
|
||||||
char buf1[256], buf2[256];
|
char buf1[256], buf2[256];
|
||||||
char fn2[256];
|
char fn2[PATH_MAX];
|
||||||
|
|
||||||
char cid[256]="";
|
char cid[256]="";
|
||||||
char *val;
|
char *val;
|
||||||
@@ -3269,7 +3269,7 @@ static int get_folder(struct ast_channel *chan, int start)
|
|||||||
{
|
{
|
||||||
int x;
|
int x;
|
||||||
int d;
|
int d;
|
||||||
char fn[256];
|
char fn[PATH_MAX];
|
||||||
d = ast_play_and_wait(chan, "vm-press"); /* "Press" */
|
d = ast_play_and_wait(chan, "vm-press"); /* "Press" */
|
||||||
if (d)
|
if (d)
|
||||||
return d;
|
return d;
|
||||||
@@ -3406,7 +3406,7 @@ static int vm_forwardoptions(struct ast_channel *chan, struct ast_vm_user *vmu,
|
|||||||
|
|
||||||
static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu, int msgnum, long duration, char *fmt, char *cidnum, char *cidname)
|
static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu, int msgnum, long duration, char *fmt, char *cidnum, char *cidname)
|
||||||
{
|
{
|
||||||
char todir[256], fn[256], ext_context[256], *stringp;
|
char todir[PATH_MAX], fn[PATH_MAX], ext_context[PATH_MAX], *stringp;
|
||||||
int newmsgs = 0, oldmsgs = 0;
|
int newmsgs = 0, oldmsgs = 0;
|
||||||
|
|
||||||
make_dir(todir, sizeof(todir), vmu->context, vmu->mailbox, "INBOX");
|
make_dir(todir, sizeof(todir), vmu->context, vmu->mailbox, "INBOX");
|
||||||
@@ -3718,7 +3718,7 @@ static int play_message_callerid(struct ast_channel *chan, struct vm_state *vms,
|
|||||||
int res = 0;
|
int res = 0;
|
||||||
int i;
|
int i;
|
||||||
char *callerid, *name;
|
char *callerid, *name;
|
||||||
char prefile[256]="";
|
char prefile[PATH_MAX] = "";
|
||||||
|
|
||||||
|
|
||||||
/* If voicemail cid is not enabled, or we didn't get cid or context from the attribute file, leave now. */
|
/* If voicemail cid is not enabled, or we didn't get cid or context from the attribute file, leave now. */
|
||||||
@@ -3802,7 +3802,7 @@ static int play_message_duration(struct ast_channel *chan, struct vm_state *vms,
|
|||||||
static int play_message(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm_state *vms)
|
static int play_message(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm_state *vms)
|
||||||
{
|
{
|
||||||
int res = 0;
|
int res = 0;
|
||||||
char filename[256],*origtime, *cid, *context, *duration;
|
char filename[PATH_MAX], *origtime, *cid, *context, *duration;
|
||||||
char *category;
|
char *category;
|
||||||
struct ast_config *msg_cfg;
|
struct ast_config *msg_cfg;
|
||||||
|
|
||||||
@@ -4633,7 +4633,7 @@ static int vm_newuser(struct ast_channel *chan, struct ast_vm_user *vmu, struct
|
|||||||
int tries = 0;
|
int tries = 0;
|
||||||
char newpassword[80] = "";
|
char newpassword[80] = "";
|
||||||
char newpassword2[80] = "";
|
char newpassword2[80] = "";
|
||||||
char prefile[256]="";
|
char prefile[PATH_MAX] = "";
|
||||||
unsigned char buf[256];
|
unsigned char buf[256];
|
||||||
int bytes=0;
|
int bytes=0;
|
||||||
|
|
||||||
@@ -4711,7 +4711,7 @@ static int vm_options(struct ast_channel *chan, struct ast_vm_user *vmu, struct
|
|||||||
int duration = 0;
|
int duration = 0;
|
||||||
char newpassword[80] = "";
|
char newpassword[80] = "";
|
||||||
char newpassword2[80] = "";
|
char newpassword2[80] = "";
|
||||||
char prefile[256]="";
|
char prefile[PATH_MAX] = "";
|
||||||
unsigned char buf[256];
|
unsigned char buf[256];
|
||||||
int bytes=0;
|
int bytes=0;
|
||||||
|
|
||||||
@@ -4807,9 +4807,9 @@ static int vm_tempgreeting(struct ast_channel *chan, struct ast_vm_user *vmu, st
|
|||||||
int cmd = 0;
|
int cmd = 0;
|
||||||
int retries = 0;
|
int retries = 0;
|
||||||
int duration = 0;
|
int duration = 0;
|
||||||
char prefile[256]="";
|
char prefile[PATH_MAX] = "";
|
||||||
unsigned char buf[256];
|
unsigned char buf[256];
|
||||||
char dest[256];
|
char dest[PATH_MAX];
|
||||||
int bytes = 0;
|
int bytes = 0;
|
||||||
|
|
||||||
if (adsi_available(chan))
|
if (adsi_available(chan))
|
||||||
@@ -6440,7 +6440,7 @@ static int advanced_options(struct ast_channel *chan, struct ast_vm_user *vmu, s
|
|||||||
int option, signed char record_gain)
|
int option, signed char record_gain)
|
||||||
{
|
{
|
||||||
int res = 0;
|
int res = 0;
|
||||||
char filename[256],*origtime, *cid, *context, *name, *num;
|
char filename[PATH_MAX], *origtime, *cid, *context, *name, *num;
|
||||||
struct ast_config *msg_cfg;
|
struct ast_config *msg_cfg;
|
||||||
int retries = 0;
|
int retries = 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user