Commit Graph

36 Commits

Author SHA1 Message Date
Richard Mudgett 91c3ac19cb Dialplan functions: Fix some channel autoservice misuse.
* Fix off nominal paths leaving the channel in autoservice.
* Remove unnecessary start/stop channel autoservice.
* Fix channel locking around a channel datastore search.

Change-Id: I7ff2e42388064fe3149034ecae57604040b8b540
2018-06-19 10:56:33 -06:00
Corey Farrell a6e5bae3ef Remove ASTERISK_REGISTER_FILE.
ASTERISK_REGISTER_FILE no longer has any purpose so this commit removes
all traces of it.

Previously exported symbols removed:
* __ast_register_file
* __ast_unregister_file
* ast_complete_source_filename

This also removes the mtx_prof static variable that was declared when
MTX_PROFILE was enabled.  This variable was only used in lock.c so it
is now initialized in that file only.

ASTERISK-26480 #close

Change-Id: I1074af07d71f9e159c48ef36631aa432c86f9966
2016-10-27 09:53:55 -04:00
Matt Jordan 4a58261694 git migration: Refactor the ASTERISK_FILE_VERSION macro
Git does not support the ability to replace a token with a version
string during check-in. While it does have support for replacing a
token on clone, this is somewhat sub-optimal: the token is replaced
with the object hash, which is not particularly easy for human
consumption. What's more, in practice, the source file version was often
not terribly useful. Generally, when triaging bugs, the overall version
of Asterisk is far more useful than an individual SVN version of a file. As a
result, this patch removes Asterisk's support for showing source file
versions.

Specifically, it does the following:

* Rename ASTERISK_FILE_VERSION macro to ASTERISK_REGISTER_FILE, and
  remove passing the version in with the macro. Other facilities
  than 'core show file version' make use of the file names, such as
  setting a debug level only on a specific file. As such, the act of
  registering source files with the Asterisk core still has use. The
  macro rename now reflects the new macro purpose.

* main/asterisk:
  - Refactor the file_version structure to reflect that it no longer
    tracks a version field.
  - Remove the "core show file version" CLI command. Without the file
    version, it is no longer useful.
  - Remove the ast_file_version_find function. The file version is no
    longer tracked.
  - Rename ast_register_file_version/ast_unregister_file_version to
    ast_register_file/ast_unregister_file, respectively.

* main/manager: Remove value from the Version key of the ModuleCheck
  Action. The actual key itself has not been removed, as doing so would
  absolutely constitute a backwards incompatible change. However, since
  the file version is no longer tracked, there is no need to attempt to
  include it in the Version key.

* UPGRADE: Add notes for:
  - Modification to the ModuleCheck AMI Action
  - Removal of the "core show file version" CLI command

Change-Id: I6cf0ff280e1668bf4957dc21f32a5ff43444a40e
2015-04-13 03:48:57 -04:00
David M. Lee 744556c01d security: Inhibit execution of privilege escalating functions
This patch allows individual dialplan functions to be marked as
'dangerous', to inhibit their execution from external sources.

A 'dangerous' function is one which results in a privilege escalation.
For example, if one were to read the channel variable SHELL(rm -rf /)
Bad Things(TM) could happen; even if the external source has only read
permissions.

Execution from external sources may be enabled by setting
'live_dangerously' to 'yes' in the [options] section of asterisk.conf.
Although doing so is not recommended.

Also, the ABI was changed to something more reasonable, since Asterisk
12 does not yet have a public release.

(closes issue ASTERISK-22905)
Review: http://reviewboard.digium.internal/r/432/
........

Merged revisions 403913 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 403917 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 403959 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403960 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-16 19:11:51 +00:00
Matthew Jordan 89f9e077d7 Prevent crashes from occurring when reading from data sources with large values
When reading configuration data from an Asterisk .conf file or when pulling
data from an Asterisk RealTime backend, Asterisk was copying the data on the
stack for manipulation. Unfortunately, it is possible to read configuration
data or realtime data from some data source that provides a large blob of
characters. This could potentially cause a crash via a stack overflow.

This patch prevents large sets of data from being read from an ARA backend or
from an Asterisk conf file.

(issue ASTERISK-20658)
Reported by: wdoekes
Tested by: wdoekes, mmichelson
patches:
 * issueA20658_dont_process_overlong_config_lines.patch uploaded by wdoekes (license 5674)
 * issueA20658_func_realtime_limit.patch uploaded by wdoekes (license 5674)
........

Merged revisions 378375 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 378376 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378377 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-02 22:10:32 +00:00
Tilghman Lesher 6190ae4430 Allow the REALTIME() function to report errors back to the caller.
Also, do more error checking on the arguments specified to the REALTIME()
function and clarify the documentation.  While I was editing the file, a
few coding guidelines fixups, as well.

Review: https://reviewboard.asterisk.org/r/2031/
........

Merged revisions 369937 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 369938 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369940 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-11 17:16:50 +00:00
Kevin P. Fleming 166b4e2b30 Multiple revisions 369001-369002
........
  r369001 | kpfleming | 2012-06-15 10:56:08 -0500 (Fri, 15 Jun 2012) | 11 lines
  
  Add support-level indications to many more source files.
  
  Since we now have tools that scan through the source tree looking for files
  with specific support levels, we need to ensure that every file that is
  a component of a 'core' or 'extended' module (or the main Asterisk binary)
  is explicitly marked with its support level. This patch adds support-level
  indications to many more source files in tree, but avoids adding them to
  third-party libraries that are included in the tree and to source files
  that don't end up involved in Asterisk itself.
........
  r369002 | kpfleming | 2012-06-15 10:57:14 -0500 (Fri, 15 Jun 2012) | 3 lines
  
  Add a script to enable finding source files without support-levels defined.
........

Merged revisions 369001-369002 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 369005 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369013 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-15 16:20:16 +00:00
Andrew Latham f9c3b26241 Add Function and Application Relationships to documentation
Add and extend the see-also sections to the documentation for applications
and functions in an effort to expand the online documentation of the wiki.
Also check for and update any links to moved documentation in the doc folder.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@304913 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-30 00:22:59 +00:00
Tilghman Lesher f8c37545ad Merged revisions 206807 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r206807 | tilghman | 2009-07-16 11:27:35 -0500 (Thu, 16 Jul 2009) | 6 lines
  
  Fix a memory leak.
  (closes issue #15517)
   Reported by: adomjan
   Patches: 
         func_realtime.c-ast_variable_destroy.diff uploaded by adomjan (license 487)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@206808 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-16 16:51:05 +00:00
Kevin P. Fleming 82fb56886e More 'static' qualifiers on module global variables.
The 'pglobal' tool is quite handy indeed :-)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@200620 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-15 17:34:30 +00:00
Tilghman Lesher c8223fc957 Merge ast_str_opaque branch (discontinue usage of ast_str internals)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@163991 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-13 08:36:35 +00:00
Michiel van Baak 2fb4ecc87c last commit worked on OpenBSD but still generated warning on Ubuntu.
Initialise a variable so --enable-dev-mode does not complain


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@158723 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-22 17:17:33 +00:00
Michiel van Baak 12071c18f0 make this compile under devmode
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@158686 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-22 15:58:49 +00:00
Tilghman Lesher e316c21986 Two new functions, REALTIME_FIELD, and REALTIME_HASH, which should make
querying realtime from the dialplan a little more consistent and easy to use.
The original REALTIME function is preserved, for those who are already
accustomed to that interface.
(closes issue #13651)
 Reported by: Corydon76
 Patches: 
       20081119__bug13651__2.diff.txt uploaded by Corydon76 (license 14)
 Tested by: blitzrage, Corydon76


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@157870 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-19 21:54:39 +00:00
Russell Bryant 5b168ee34b Merge changes from team/group/appdocsxml
This commit introduces the first phase of an effort to manage documentation of the
interfaces in Asterisk in an XML format.  Currently, a new format is available for
applications and dialplan functions.  A good number of conversions to the new format
are also included.

For more information, see the following message to asterisk-dev:

http://lists.digium.com/pipermail/asterisk-dev/2008-October/034968.html


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@153365 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-01 21:10:07 +00:00
Michiel van Baak 8e8359465b Older versions of GNU gcc do not allow 'NULL' as sentinel.
They want (char *)NULL as sentinel.
An example is OpenBSD (confirmed on 4.3) that ships with gcc 3.3.4

This commit introduces a contstant SENTINEL which is declared as:
#define SENTINEL ((char *)NULL)

All places I could test compile on my openbsd system are converted.
Update CODING-GUIDELINES to tell about this constant.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@124127 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-19 20:48:33 +00:00
Terry Wilson 6e7659e6b1 Add REALTIME_STORE and REALTIME_DESTROY dialplan functions provided by sergee.
I just added the ability to set multiple fields at once after discussions with
Tilghman and Russell.  Currently limited to 30 fields.

(closes issue #11887)
Reported by: sergee
Patches: 
      rt-func-store-destroy-multivalue.diff uploaded by otherwiseguy (license 396)
Tested by: sergee, otherwiseguy


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@102700 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-06 16:23:22 +00:00
Joshua Colp 7492c04a23 Add missing braces.
(closes issue #11886)
Reported by: sergee
Patches:
      func_realtime_fix-r101392.diff uploaded by sergee (license 138)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@101393 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-31 15:36:11 +00:00
Luigi Rizzo 7e8835e0d7 remove another set of redundant #include "asterisk/options.h"
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89512 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-21 23:24:55 +00:00
Luigi Rizzo 9335ace850 another bunch of include removals (errno.h and asterisk/logger.h)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89425 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-19 19:09:03 +00:00
Luigi Rizzo fdb7f7ba3d Start untangling header inclusion in a way that does not affect
build times - tested, there is no measureable difference before and
after this commit.

In this change:

use asterisk/compat.h to include a small set of system headers:
inttypes.h, unistd.h, stddef.h, stddint.h, sys/types.h, stdarg.h,
stdlib.h, alloca.h, stdio.h

Where available, the inclusion is conditional on HAVE_FOO_H as determined
by autoconf.

Normally, source files should not include any of the above system headers,
and instead use either "asterisk.h" or "asterisk/compat.h" which does it
better. 

For the time being I have left alone second-level directories
(main/db1-ast, etc.).



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89333 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-16 20:04:58 +00:00
Tilghman Lesher 64a0a9aa2c Merged revisions 87262 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r87262 | tilghman | 2007-10-28 08:46:55 -0500 (Sun, 28 Oct 2007) | 7 lines

Add autoservice to several more functions which might delay in their responses.
Also, make sure that func_odbc functions have a channel on which to set
variables.
Reported by russell
Fixed by tilghman
Closes issue #11099

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@87263 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-28 14:11:01 +00:00
Tilghman Lesher 55b1ee298e Merge the dialplan_aesthetics branch. Most of this patch simply converts applications
using old methods of parsing arguments to using the standard macros.  However, the big
change is that the really old way of specifying application and arguments separated by
a comma will no longer work (e.g. NoOp,foo|bar).  Instead, the way that has been
recommended since long before 1.0 will become the only method available (e.g. NoOp(foo,bar).


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@76703 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-23 19:51:41 +00:00
Joshua Colp e498488bde For my next trick I will make it so dialplan functions no longer need to call ast_module_user_add and ast_module_user_remove. These are now called in the ast_func_read and ast_func_write functions outside of the module.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75255 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-16 18:24:29 +00:00
Joshua Colp 96a646734f It is no longer required for each module that deals with a channel to call ast_module_user_hangup_all in it's unload function. The loader will automatically perform this action for it.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75183 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-16 13:35:20 +00:00
Tilghman Lesher cb8b3e1efb Merged revisions 58933 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r58933 | tilghman | 2007-03-15 17:32:33 -0500 (Thu, 15 Mar 2007) | 2 lines

Function works fine, but the documentation is backwards.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@58934 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-15 22:33:46 +00:00
Tilghman Lesher 63cc6e10b4 Formatting fixes
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@53980 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-12 02:44:33 +00:00
Tilghman Lesher c4c2c546da When calling the Realtime app more than once, unset fields which were
previously set are erroneously still set (Bug 6701).  After discussion,
it was determined this should only be changed in trunk.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@49801 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-07 16:21:12 +00:00
Kevin P. Fleming 37182c873e finish const-ifying ast_func_read()
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@49741 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-06 00:13:33 +00:00
Luigi Rizzo 7c5f06ddcd replace ast_build_string() with ast_str_*().
Unless i am very mistaken, function_realtime_read() was
broken in that it would always return an empty string
(because ast_build_string() advanced the pointer to the
end of the string, and there was no reference to the
initial value.

This commit should fix this problem.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48551 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-17 22:57:46 +00:00
Kevin P. Fleming 0a27d8bfe5 merge new_loader_completion branch, including (at least):
- restructured build tree and makefiles to eliminate recursion problems
  - support for embedded modules
  - support for static builds
  - simpler cross-compilation support
  - simpler module/loader interface (no exported symbols)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@40722 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-21 02:11:39 +00:00
Kevin P. Fleming 472c1ca282 simplify autoconfig include mechanism (make tholo happy he can use lint again :-)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@32846 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-06-07 18:54:56 +00:00
Russell Bryant 3d022d073a fix the build of func_realtime and aelparse with MTX_PROFILE enabled
(issue #7187, #7188, casper)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@28895 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-05-20 00:41:36 +00:00
Russell Bryant a21507a60a suppress a compiler warning
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@24534 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-05-03 19:10:41 +00:00
Luigi Rizzo 2d5900391b remove variable declarations in the middle of two blocks.
While at it, normalize the surrounding code.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@24495 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-05-03 18:22:04 +00:00
BJ Weschke a9281a1142 Introducing the REALTIME() dialplan function
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@24376 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-05-02 22:46:12 +00:00