[asterisk-bugs] [JIRA] (ASTERISK-22459) username not parsed correctly in res_odbc.conf

Walter Doekes (JIRA) noreply at issues.asterisk.org
Wed Sep 18 10:45:03 CDT 2013


    [ https://issues.asterisk.org/jira/browse/ASTERISK-22459?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=210378#comment-210378 ] 

Walter Doekes commented on ASTERISK-22459:
------------------------------------------

Indeed.

If I run {{/usr/share/doc/libiodbc2-dev/examples/iodbctest.c.gz}}, I get this:

{noformat}
$ gcc test.c -liodbc
$ ./a.out 'DSN=mydb;UID=myuser;PWD=mypass' >/dev/null
1: SQLDriverConnect = ��������������������������������� (0) SQLSTATE=
{noformat}
{noformat}
$ gcc -DUNICODE test.c -liodbc
$ ./a.out 'DSN=mydb;UID=myuser;PWD=mypass' >/dev/null
1: SQLDriverConnectW = ������������������������������������������������������������������������������������������������������������������������������������������������������������������������ (0) SQLSTATE=����������0
{noformat}

Something is fishy with that iodbc lib.

It does write stuff to my trace log, but it's not promising. And SQLGetDiagRec returns utter garbage.

I could see how a warning to not try iodbc would be appropriate.

----

{noformat}
--- test.c.orig	2013-09-18 16:53:29.000000000 +0200
+++ test.c	2013-09-18 16:56:24.000000000 +0200
@@ -146,7 +146,7 @@
 
   length = strlen (sourStr);
   if (length > 0)
-    OPL_A2W (sourStr, destStr, length);
+    OPL_A2W (sourStr, (wchar_t *) destStr, length);
   destStr[length] = L'\0';
 
   return destStr;
@@ -1089,7 +1089,7 @@
    */
   ODBC_Disconnect ();
 
-  printf ("\nHave a nice day.");
+  printf ("\nHave a nice day.\n");
 
   return 0;
 }
{noformat}
                
> username not parsed correctly in res_odbc.conf
> ----------------------------------------------
>
>                 Key: ASTERISK-22459
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-22459
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Resources/res_odbc
>    Affects Versions: 11.5.1
>         Environment: Debian linux (squeeze), ODBC/MysQL
>            Reporter: Patrick Maille
>         Attachments: extrafull
>
>
> When I set (in res_odbc.conf):
> username=>asterisk
> the mysql logs show:
> 130904 15:51:30    57 Connect   Access denied for user 'a'@'localhost' (using password: YES)
> If I set (in res_odbc.conf):
> username=>debian
> the mysql logs show:
> 130904 15:52:30    63 Connect   Access denied for user 'd'@'localhost' (using password: YES)
> So it looks like it's only taking the first letter of the username for authentication to the database.
> I confirmed that my odbc/mysql stack works:
> $ echo "select 1" | isql -v asterisk-connector asterisk Test1234
> +---------------------------------------+
> | Connected!                            |
> |                                       |
> | sql-statement                         |
> | help [tablename]                      |
> | quit                                  |
> |                                       |
> +---------------------------------------+
> SQL> select 1
> +---------------------+
> | 1                   |
> +---------------------+
> | 1                   |
> +---------------------+
> SQLRowCount returns 1
> 1 rows fetched

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.asterisk.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the asterisk-bugs mailing list