summaryrefslogtreecommitdiff
path: root/funcs/func_lock.c
AgeCommit message (Collapse)Author
2017-12-22Remove as much trailing whitespace as possible.Sean Bright
Change-Id: I873c1c6d00f447269bd841494459efccdd2c19c0
2016-10-27Remove ASTERISK_REGISTER_FILE.Corey Farrell
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
2015-04-13git migration: Refactor the ASTERISK_FILE_VERSION macroMatt Jordan
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
2013-12-16security: Inhibit execution of privilege escalating functionsDavid M. Lee
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
2012-07-18Ensure that all ast_datastore_info structures are 'const'.Kevin P. Fleming
While addressing a bug, I came across a instance of 'struct ast_datastore_info' that was not declared 'const'. Since the API already expects them to be 'const', this patch changes the declarations of all existing instances that were not already declared that way. ........ Merged revisions 370183 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 370184 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370187 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-10Resolve FORWARD_NULL static analysis warningsKinsey Moore
This resolves core findings from ASTERISK-19650 numbers 0-2, 6, 7, 9-11, 14-20, 22-24, 28, 30-32, 34-36, 42-56, 82-84, 87, 89-90, 93-102, 104, 105, 109-111, and 115. Finding numbers 26, 33, and 29 were already resolved. Those skipped were either extended/deprecated or in areas of code that shouldn't be disturbed. (Closes issue ASTERISK-19650) ........ Merged revisions 366167 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 366168 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366169 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-10Coverity Report: Fix issues for error type CHECKED_RETURN for coreJonathan Rose
(issue ASTERISK-19658) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/1905/ ........ Merged revisions 366094 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 366106 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366126 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-10Fix absolute/relative time mismatch in LOCK function.Richard Mudgett
The time passed by the LOCK function to an internal function was relative time when the function expected absolute time. * Don't use C++ keywords in get_lock(). (closes issue ASTERISK-16868) Reported by: Andrey Solovyev Patches: 20101102__issue18207.diff.txt (license #5003) patch uploaded by Andrey Solovyev (modified) ........ Merged revisions 350311 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 350312 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350313 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-09Replace direct access to channel name with accessor functionsTerry Wilson
There are many benefits to making the ast_channel an opaque handle, from increasing maintainability to presenting ways to kill masquerades. This patch kicks things off by taking things a field at a time, renaming the field to '__do_not_use_${fieldname}' and then writing setters/getters and converting the existing code to using them. When all fields are done, we can move ast_channel to a C file from channel.h and lop off the '__do_not_use_'. This patch sets up main/channel_interal_api.c to be the only file that actually accesses the ast_channel's fields directly. The intent would be for any API functions in channel.c to use the accessor functions. No more monkeying around with channel internals. We should use our own APIs. The interesting changes in this patch are the addition of channel_internal_api.c, the moving of the AST_DATA stuff from channel.c to channel_internal_api.c (note: the AST_DATA stuff will have to be reworked to use accessor functions when ast_channel is really opaque), and some re-working of the way channel iterators/callbacks are handled so as to avoid creating fake ast_channels on the stack to pass in matching data by directly accessing fields (since "name" is a stringfield and the fake channel doesn't init the stringfields, you can't use the ast_channel_name_set() function). I went with ast_channel_name(chan) for a getter, and ast_channel_name_set(chan, name) for a setter. The majority of the grunt-work for this change was done by writing a semantic patch using Coccinelle ( http://coccinelle.lip6.fr/ ). Review: https://reviewboard.asterisk.org/r/1655/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350223 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-14Merged revisions 328247 via svnmerge from Leif Madsen
https://origsvn.digium.com/svn/asterisk/branches/1.10 ................ r328247 | lmadsen | 2011-07-14 16:25:31 -0400 (Thu, 14 Jul 2011) | 14 lines Merged revisions 328209 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r328209 | lmadsen | 2011-07-14 16:13:06 -0400 (Thu, 14 Jul 2011) | 6 lines Introduce <support_level> tags in MODULEINFO. This change introduces MODULEINFO into many modules in Asterisk in order to show the community support level for those modules. This is used by changes committed to menuselect by Russell Bryant recently (r917 in menuselect). More information about the support level types and what they mean is available on the wiki at https://wiki.asterisk.org/wiki/display/AST/Asterisk+Module+Support+States ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@328259 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-01Fix a build error on FreeBSD.Russell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@232012 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-30Allow locks to be inherited through a masquerade without causing starvation.Tilghman Lesher
(closes issue #14859) Reported by: atis Patches: 20090821__issue14859.diff.txt uploaded by tilghman (license 14) 20090925__issue14859__1.6.1.diff.txt uploaded by tilghman (license 14) Tested by: atis, tilghman git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@221044 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-15More 'static' qualifiers on module global variables.Kevin P. Fleming
The 'pglobal' tool is quite handy indeed :-) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@200620 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-29Merge str_substitution branch.Tilghman Lesher
This branch adds additional methods to dialplan functions, whereby the result buffers are now dynamic buffers, which can be expanded to the size of any result. No longer are variable substitutions limited to 4095 bytes of data. In addition, the common case of needing buffers much smaller than that will enable substitution to only take up the amount of memory actually needed. The existing variable substitution routines are still available, but users of those API calls should transition to using the dynamic-buffer APIs. Reviewboard: http://reviewboard.digium.com/r/174/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@191140 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-01Merge changes from team/group/appdocsxmlRussell Bryant
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-08-05make datastore creation and destruction a generic API since it is not really ↵Kevin P. Fleming
channel related, and add the ability to add/find/remove datastores to manager sessions git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@135680 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-21remove another set of redundant #include "asterisk/options.h"Luigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89512 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-19another bunch of include removals (errno.h and asterisk/logger.h)Luigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89425 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-16remove a bunch of duplicate includesLuigi Rizzo
Reproduce with grep -r #include . | grep -v .svn | grep -v Binary | sort | uniq -c | sort -nr git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89348 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-16Start untangling header inclusion in a way that does not affectLuigi Rizzo
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-10-27Make sure a channel exists before attempting to start or stop channelRussell Bryant
autoservice in func_lock and func_shell. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@87233 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-30* The documentation for the LOCK() function says that it will block for up toRussell Bryant
3 seconds while waiting on a lock when other locks are currently held to avoid deadlocks. Change the code to reflect this. * Since trying to grab a lock may block for some time, put the channel in autoservice so that audio is still read from the channel and that any active generators on the channel don't pause. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@84143 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-17store and destroy implementations for realtime pgsql (closes issue #10372)Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@79859 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-16Revise dialplan locks to permit multiple locks per channel, but with ↵Tilghman Lesher
deadlock avoidance git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@79813 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-31Add some documentation detailing an aspect of dialplan functions, as ↵Tilghman Lesher
requested by Russell git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77838 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-31Add func_lock, which creates dialplan mutexes, and note that the Macro apps ↵Tilghman Lesher
are now deprecated. (Closes issue #10264) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77834 65c4cc65-6c06-0410-ace0-fbb531ad65f3