static char ext_pass_cmd[128];
+int my_umask;
+
#if ODBC_STORAGE
#define tdesc "Comedian Mail (Voicemail System) with ODBC Storage"
#elif IMAP_STORAGE
{
FILE *p = NULL;
int pfd = mkstemp(template);
+ chmod(template, VOICEMAIL_FILE_MODE & ~my_umask);
if (pfd > -1) {
p = fdopen(pfd, "w+");
if (!p) {
create_dirpath(tmpdir, sizeof(tmpdir), vmu->context, vmu->mailbox, "tmp");
snprintf(newtmp, sizeof(newtmp), "%s/XXXXXX", tmpdir);
tmpfd = mkstemp(newtmp);
+ chmod(newtmp, VOICEMAIL_FILE_MODE & ~my_umask);
if (option_debug > 2)
ast_log(LOG_DEBUG, "newtmp: %s\n", newtmp);
if (tmpfd > -1) {
#endif
snprintf(tmptxtfile, sizeof(tmptxtfile), "%s/XXXXXX", tmpdir);
txtdes = mkstemp(tmptxtfile);
+ chmod(tmptxtfile, VOICEMAIL_FILE_MODE & ~my_umask);
if (txtdes < 0) {
res = ast_streamfile(chan, "vm-mailboxfull", chan->language);
if (!res)
static int load_module(void)
{
int res;
+ my_umask = umask(0);
+ umask(my_umask);
res = ast_register_application(app, vm_exec, synopsis_vm, descrip_vm);
res |= ast_register_application(app2, vm_execmain, synopsis_vmain, descrip_vmain);
res |= ast_register_application(app3, vm_box_exists, synopsis_vm_box_exists, descrip_vm_box_exists);