[Home]

Summary:ASTERISK-05703: [patch] Allow ',' in extconfig database and table
Reporter:Manuel Guesdon (mguesdon)Labels:
Date Opened:2005-11-25 07:49:42.000-0600Date Closed:2005-12-26 23:43:11.000-0600
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Core/Configuration
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) config4.diff
( 1) config5.diff
Description:It would be (very very) nice to allow ',' in extconfig database name and table name so we can put ldap root dn as database name.
This syntax will allow that:
testfamily => ldap,"dc=oxymium,dc=net",testfamily

Comments:By: Tony McCrary (tmccrary) 2005-11-27 21:26:29.000-0600

Here is a patch that checks the beginning of the string for a double quote.

If it finds one, it tokenizes the text up to the next quote, and then procedes normally.

If it doesn't find a double quote at the beginning, it just behaves normally.

By: Tony McCrary (tmccrary) 2005-11-27 21:49:23.000-0600

I have submitted a second patch, which uses ast_copy_string instead of strncpy.

Please disregard the first patch.

Thanks!

By: Jason Parker (jparker) 2005-11-27 21:50:35.000-0600

At first glance, you have 5 too many "empty" lines (hint, two inside the if, two inside the else, one outside the else).  You also have a few tabs in the "empty" lines - you might want to remove those tabs.

By: Tony McCrary (tmccrary) 2005-11-27 21:52:03.000-0600

Okay, I'll take a look at it.

Sorry if I'm doing things wrong, this is my first attempt to contribute to a project like this.

By: Tony McCrary (tmccrary) 2005-11-27 22:06:51.000-0600

Okay, I've made some changes.

A person on IRC kindly pointed me towards the coding guidelines and I tried to follow them as best I could.

If there are any other changes that need to be made, let me know!

(I added a 4th patch as I noticed some more whitespace)



By: Tilghman Lesher (tilghman) 2005-11-27 22:23:08.000-0600

We need you to file a disclaimer with Digium.

By: Tilghman Lesher (tilghman) 2005-11-27 22:27:26.000-0600

Also, ast_copy_string needs the full size of the buffer, so instead of doing:

ast_copy_string(quotecheck, stringp, 1);

you need to instead do:

ast_copy_string(quotecheck, stringp, sizeof(quotecheck));

Without this, you'll simply only ever get an empty string in quotecheck.

By: Tony McCrary (tmccrary) 2005-11-27 22:42:23.000-0600

okay, I've made the changes and tested them. They seem to work properly.

I'll file the disclaimer tomorrow (as it's almost midnight here).

By: Tony McCrary (tmccrary) 2005-11-28 10:38:39.000-0600

I've faxed the disclaimer form.

By: Tilghman Lesher (tilghman) 2005-12-26 23:43:00.000-0600

Committed to trunk, with minor modifications.