Commit Graph

33 Commits

Author SHA1 Message Date
Doug Bailey
9d266db16a Add check in configure script to check for GLOB_NOMAGIC and GLOB_BRACE in glob.h
This allows config.c to compile when linked against uclibc that does not support these parameters


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@189601 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-21 14:00:55 +00:00
Mark Michelson
b7585650d9 Fix the logic in config_text_file_save so that if an
UpdateConfig manager action is issued and the
file specified in DstFileName does not yet exist,
an error is not returned.

(closes issue #13341)
Reported by: vadim
Patches:
      13341.patch uploaded by putnopvut (license 60)
	  (with small modification from seanbright)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@139769 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-25 15:52:59 +00:00
Tilghman Lesher
678b90e2a0 Textual clarification
(closes issue #13106)
 Reported by: flefoll
 Patches: 
       config.c.br14.120173.patch-unknown-directive uploaded by flefoll (license 244)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@132107 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-18 18:47:50 +00:00
Jeff Peeler
27855de29f (closes issue #11594)
Reported by: yem
Tested by: yem

This change decreases the buffer size allocated on the stack substantially in config_text_file_load when LOW_MEMORY is turned on. This change combined with the fix from revision 117462 (making mkintf not copy the zt_chan_conf structure) was enough to prevent the crash.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@120173 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-03 22:15:33 +00:00
Steve Murphy
88b0da7c6c (closes issue #11442)
Reported by: tzafrir
Patches:
      11442.patch uploaded by murf (license 17)
Tested by: murf

I didn't give tzafrir very much time to test this, but if he does 
still have remaining issues, he is welcome to 
re-open this bug, and we'll do what is called for.

I reproduced the problem, and tested the fix, so I hope I
am not jumping by just going ahead and committing the fix.

The problem was with what file_save does with templates; 
firstly, it tended to print out multiple options:

[my_category](!)(templateref)

instead of 

[my_category](!,templateref)

which is fixed by this patch.


Nextly, the code to suppress output of duplicate declarations
that would occur because the reader copies inherited declarations
down the hierarchy, was not working. Thus:


 [master-template](!)
 mastervar = bar


 [template](!,master-template)
 tvar = value


 [cat](template)
 catvar = val


would be rewritten as:

 ;!
 ;! Automatically generated configuration file
 ;! Filename: experiment.conf (/etc/asterisk/experiment.conf)
 ;! Generator: Manager
 ;! Creation Date: Tue Mar 18 23:17:46 2008
 ;!
 
 [master-template](!)
 mastervar = bar

 
 [template](!,master-template)
 mastervar = bar
 tvar = value

 
 [cat](template)
 mastervar = bar
 tvar = value
 catvar = val

This has been fixed. Since the config reader 'explodes' inherited
vars into the category, users may, in certain circumstances, see
output different from what they originally entered, but it should
be both correct and equivalent.




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@109908 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-19 15:41:13 +00:00
Jason Parker
e1fb43d32a Allow the use of #include and #exec in situations where the max include depth was only 1.
Specifically, this fixes using #include and #exec in extconfig.conf.

This was basically caused because the config file itself raises the include level to 1.

I opted not to raise the include limit, because recursion here could cause very bizarre behavior.

Pointed out, and tested by jmls

(closes issue #12064)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@104092 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-25 20:49:42 +00:00
Russell Bryant
4965b39719 There are a lot of existing systems that #include non-existent files. So, to
make the transition to treating this as an error a bit less painless, just issue
a huge error message for now.  Then, later, we can reinstate the code that treats
it as a failure.

(Thanks to philippel for the feedback)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@93000 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-14 17:36:08 +00:00
Jason Parker
8771f23fff If a typo is found in a config file, we previous continued on with what was already loaded.
We do not want to do this (see bug below for details).

This makes it so that if a [ is found without a ], the entire config will fail, and nothing in it will be loaded.

Isue #10690.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@92696 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-13 00:11:09 +00:00
Tilghman Lesher
472eb33648 If two config writes collide, file corruption could result. Use a mkstemp() file, instead.
Reported by: paravoid
Patch by: tilghman
Closes issue #10781


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89191 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-12 20:16:18 +00:00
Steve Murphy
712b337863 closes issue #8786 - where the [catname](!) and [catname](othercat1,othercat2,...) notation gets dropped across a ConfigUpdate (or any other thing that would cause a config file to be written). While I was at it, I also cleaned up some of the destroy routines to free up comments, which was not being done. Made sure the new struct I introduced is also cleaned up properly at destruction time. My code handles multiple template inclusions. Many thanks to ssokol for his patch, which, while not literally used in the final merge, served as a foundation for the fix.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89036 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-06 17:52:50 +00:00
Jason Parker
e4f15628bb Fix an issue with using UpdateConfig (manager action) where escaped semicolons
in a config would be converted to just semicolons (\; to ;)

Issue 9938


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78180 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-06 16:30:51 +00:00
Mark Michelson
05ba4d90d4 Changed the behavior of sip's realtime_peer function to match the corresponding way of matching for non-realtime peers.
Now matches are made on both the IP address and port number, or if the insecure setting is set to "port" then just match on the
IP address.

In order to accomplish this, I also added a new API call, ast_category_root, which returns the first variable of an ast_category struct



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78103 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-03 20:25:22 +00:00
Jason Parker
dbfc0c7daa Merged revisions 69469 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r69469 | qwell | 2007-06-14 18:21:45 -0500 (Thu, 14 Jun 2007) | 4 lines

Fix an issue where the line number in an unterminated comment block error message would show the wrong line number.

"Reported" to me on #asterisk (somebody posted an error message, and I happened to catch it)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@69470 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-14 23:22:51 +00:00
Olle Johansson
53929c4f01 Don't remove configuration from memory just because one section failed.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@63254 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-07 20:05:15 +00:00
Joshua Colp
19a9e28b09 Merged revisions 61958 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r61958 | file | 2007-04-25 21:25:03 -0400 (Wed, 25 Apr 2007) | 2 lines

Don't count failed include attempts against the configuration include level. (issue #9593 reported by mostyn)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61959 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-26 01:27:18 +00:00
Russell Bryant
70eb19121e Fix the UpdateConfig manager action to properly treat "variables" and "objects"
differently (a=b versus a=>b).
(issue #9568, reported by pari, patch by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61690 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-20 18:19:18 +00:00
Steve Murphy
85cdf6218e Fix for 9257; by eliminating the globals in main/config.c, we make it thread-safe, which is a minimum requirement.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59225 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-26 20:06:12 +00:00
Joshua Colp
089486cfcf Merged revisions 53117 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r53117 | file | 2007-02-02 10:58:09 -0600 (Fri, 02 Feb 2007) | 2 lines

Pass the glob expanded filename to process_text_line so that error messages contain the actual filename, not the original include one. (issue #8959 reported by tzafrir)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53118 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-02 16:59:53 +00:00
Russell Bryant
de14e3d549 It is possible for the config pointer to be NULL here, so it needs to be
checked before dereferencing it.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51057 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-16 01:15:44 +00:00
Joshua Colp
c4d1757329 Fix parsing when using something like ldap settings. (done by anthonyl)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@50405 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-10 19:46:29 +00:00
Kevin P. Fleming
444adcb477 reduce stack consumption for AMI and AMI/HTTP requests by nearly 20K in most cases
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49676 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-05 22:16:33 +00:00
Joshua Colp
3d460e5a68 Only free comments and line buffer once we reach the first level. (issue #8678 reported by ssokol, fixed by anthonyl)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49551 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-04 22:28:29 +00:00
Kevin P. Fleming
7a5771161e Merged revisions 47686,47688-47689 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r47686 | kpfleming | 2006-11-15 13:42:05 -0600 (Wed, 15 Nov 2006) | 2 lines

clear the category's variable tail pointer as well when variables are detached from it

........
r47688 | kpfleming | 2006-11-15 13:47:43 -0600 (Wed, 15 Nov 2006) | 2 lines

when appending a list of variable to a category, ensure the tail pointer points to the last variable in the list

........
r47689 | kpfleming | 2006-11-15 13:58:46 -0600 (Wed, 15 Nov 2006) | 2 lines

when re-writing the config file, don't repeat the path if it hasn't changed

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47690 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-15 20:01:22 +00:00
Kevin P. Fleming
cb4ed839c3 Merged revisions 47682 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r47682 | kpfleming | 2006-11-15 12:39:47 -0600 (Wed, 15 Nov 2006) | 2 lines

ouch... don't use printf, use ast_log/ast_verbose

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47684 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-15 18:43:30 +00:00
Steve Murphy
2a0ac6ad9a This solves bug 8342, whereby a crash occurs under certain circumstances while reading a config file with comments-- a call to CB_ADD shouldn't happen if withcomments is zero
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47576 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-13 19:15:12 +00:00
Tilghman Lesher
e05a2752e8 Reverse change of "show" to "list" and make several other commands more consistent with "category verb arguments"
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47051 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-02 23:00:20 +00:00
Steve Murphy
a0078bbbc0 Cleanups suggested by Russell.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46760 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-01 17:48:48 +00:00
Mark Spencer
72146fab32 Fix config comment code preservation code (thanks murf!)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46287 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-26 01:37:40 +00:00
Tilghman Lesher
70af28270d Constify the result of a config retrieval function, to avoid mutilation (issue 7983).
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@43364 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-20 20:40:39 +00:00
Matt O'Gorman
d0a1a0033d similar patch for verbose vs debug with minor changes
bug 2617


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@43272 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-19 16:23:45 +00:00
Kevin P. Fleming
fcb999c01c merge qwell's CLI verbification work
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@43212 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-18 19:54:18 +00:00
Kevin P. Fleming
c2c4f86c72 merge markster's usersconf branch with some slight changes
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@43052 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-16 23:53:58 +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