Commit Graph

23 Commits

Author SHA1 Message Date
Pirmin Walthert 6b2d945174 app.c: make sure that no non-async-signal-safe syscalls are used after
fork before exec

Posix does only allow async-signal-safe syscalls after fork before exec.
As asterisk ignores this, functions like TrySystem or System sometimes
end up in a deadlocked child process. The patch prevents the use of
non-async-signal-safe syscalls.

ASTERISK-28776

Change-Id: Idc76365c0592ee3f3b3bd72a4f48f7a098978e8e
2020-05-08 13:44:08 -05:00
Richard Mudgett c711e4076a core: Remove ABI effects of MALLOC_DEBUG.
This allows asterisk to be compiled with MALLOC_DEBUG to load modules
built without MALLOC_DEBUG.  Now pre-compiled third-party modules will
still work regardless of MALLOC_DEBUG being enabled or not.

Change-Id: Ic07ad80b2c2df894db984cf27b16a69383ce0e10
2018-03-01 13:13:55 -06:00
Walter Doekes e6a3674150 Add builtin roundf() for systems lacking it.
(closes issue ASTERISK-16854)
Review: https://reviewboard.asterisk.org/r/2276
Reported-by: Ovidiu Sas
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@379549 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-19 20:54:07 +00:00
Kinsey Moore 9b16c8b0f6 Clean up and ensure proper usage of alloca()
This replaces all calls to alloca() with ast_alloca() which calls gcc's
__builtin_alloca() to avoid BSD semantics and removes all NULL checks
on memory allocated via ast_alloca() and ast_strdupa().

(closes issue ASTERISK-20125)
Review: https://reviewboard.asterisk.org/r/2032/
Patch-by: Walter Doekes (wdoekes)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370655 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-31 20:21:43 +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
Kinsey Moore c5b3db1956 Kill off red blobs in most of main/*
Everything still compiled after making these changes, so I assume these
whitespace-only changes didn't break anything (and shouldn't have).


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360190 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-22 19:51:16 +00:00
Tilghman Lesher cbf80fd534 Merged revisions 301263 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r301263 | tilghman | 2011-01-10 16:39:31 -0600 (Mon, 10 Jan 2011) | 8 lines
  
  Little endian machines were not converted properly.
  
  (closes issue #18583)
  Reported by: jcovert
  Patches: 
        20110110__issue18583.diff.txt uploaded by tilghman (license 14)
  Tested by: jcovert
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@301264 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-10 22:40:23 +00:00
Tilghman Lesher 7157b48150 Merged revisions 289104 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r289104 | tilghman | 2010-09-28 13:18:43 -0500 (Tue, 28 Sep 2010) | 4 lines
  
  Solaris compatibility fixes
  
  Review: https://reviewboard.asterisk.org/r/942/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@289112 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-28 18:20:20 +00:00
Tilghman Lesher f8180257e0 Merged revisions 288638 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r288638 | tilghman | 2010-09-23 22:39:29 -0500 (Thu, 23 Sep 2010) | 16 lines
  
  Merged revisions 288637 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r288637 | tilghman | 2010-09-23 22:36:01 -0500 (Thu, 23 Sep 2010) | 9 lines
    
    Merged revisions 288636 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r288636 | tilghman | 2010-09-23 22:20:24 -0500 (Thu, 23 Sep 2010) | 2 lines
      
      Solaris compatibility fixes
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@288639 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-24 03:41:02 +00:00
Tilghman Lesher 623ba816fa Don't allow file descriptors to go above 64k, when we're closing them in a fork(2).
This saves time, when, even though the system allows the process limit to be
that high, the practical limit is much lower.  Also introduce an additional
optimization, in the form of using the CLOEXEC flag to close descriptors at
the right time.

(closes issue #17223)
 Reported by: dbackeberg
 Patches: 
       20100423__issue17223.diff.txt uploaded by tilghman (license 14)
 Tested by: dbackeberg


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@260292 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-30 06:19:35 +00:00
Tilghman Lesher cfd17ef0a6 Move implementation of closefrom(3) from app.c to strcompat.c
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@233358 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-06 07:01:06 +00:00
Tilghman Lesher f46840c107 So apparently, some platforms don't have ffsll(3).
The manpage lies; it says that the function is in POSIX, but that's only for
ffs(3), not ffsll(3).


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@232164 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-02 03:26:16 +00:00
Tilghman Lesher d8e0c58437 Expand codec bitfield from 32 bits to 64 bits.
Reviewboard: https://reviewboard.asterisk.org/r/416/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@227580 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-04 14:05:12 +00:00
Tilghman Lesher d223e3636f Merged revisions 208083 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r208083 | tilghman | 2009-07-22 15:23:53 -0500 (Wed, 22 Jul 2009) | 4 lines
  
  Export symbols for functions included in our compatibility headers.
  (closes issue #15556)
   Reported by: smw1218
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@208151 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-22 22:35:57 +00:00
Tilghman Lesher cfc1df4c1a Whitespace changes only
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@105840 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-04 23:04:29 +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
Russell Bryant c29ac50c57 Merged revisions 68192 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r68192 | russell | 2007-06-07 14:30:30 -0500 (Thu, 07 Jun 2007) | 3 lines

Include stdarg.h for build issues on Solaris
(issue #9381)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@68193 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-07 19:31:05 +00:00
Olle Johansson 7e68cd14f4 Reverting part of #67864 to be able to compile agi/eagi-test that relies on this without having
ast_log and other asterisk api functions available - I could not compile on OS/X without reverting
this.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@67991 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-07 08:43:59 +00:00
Tilghman Lesher 9d05ff8ed5 Issue 9869 - replace malloc and memset with ast_calloc, and other coding guidelines changes
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@67864 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-06 21:20:11 +00:00
Russell Bryant 0a9750ef9f Merged revisions 60603 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r60603 | russell | 2007-04-06 15:58:43 -0500 (Fri, 06 Apr 2007) | 13 lines

To be able to achieve the things that we would like to achieve with the
Asterisk GUI project, we need a fully functional HTTP interface with access
to the Asterisk manager interface.  One of the things that was intended to be
a part of this system, but was never actually implemented, was the ability for
the GUI to be able to upload files to Asterisk.  So, this commit adds this in
the most minimally invasive way that we could come up with.

A lot of work on minimime was done by Steve Murphy.  He fixed a lot of bugs in
the parser, and updated it to be thread-safe.  The ability to check
permissions of active manager sessions was added by Dwayne Hubbard.  Then,
hacking this all together and do doing the modifications necessary to the HTTP
interface was done by me.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@60604 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-06 21:16:38 +00:00
Jason Parker 998ac5cab1 Only use alloca.h on OSes that have it.
Reported by jontow on IRC in #asterisk-dev


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@43230 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-18 21:24:50 +00:00
Jason Parker f18cbf77df Many Solaris fixes - this moves some of the stuff from utils.c to strcompat.c
Every OS uses strcompat now - this was done on purpose.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@42982 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-15 17:16:00 +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