Package: libdbd-sybase-perl
Version: 1.00-3
Block: 706388

Unfortunately DBD::Sybase limits the length to 32 characters. Attached
patch fixes the problem, pushing the limit to 50 characters (49 to be
more exact with respect to terminating NULL).

-- 
With best regards,
Dmitry

--- dbdimp.h.orig       2013-04-03 22:16:20.000000000 +0200
+++ dbdimp.h    2013-04-29 17:24:21.000000000 +0200
@@ -51,6 +51,9 @@
 
 #define MAX_SQL_SIZE 255
 
+/* The same as TDS_MAX_LOGIN_STR_SZ */
+#define MAX_LOGIN_STR_SZ 50
+ 
 /* Define dbh implementor data structure */
 struct imp_dbh_st {
        dbih_dbc_t com; /* MUST be first element in structure   */
@@ -71,8 +74,8 @@
        int lasterr;
        int lastsev;
 
-       char uid[32];
-       char pwd[32];
+       char uid[MAX_LOGIN_STR_SZ];
+       char pwd[MAX_LOGIN_STR_SZ];
 
        char server[64];
        char charset[64];
--- dbdimp.c.orig       2013-04-03 22:16:20.000000000 +0200
+++ dbdimp.c    2013-04-29 17:24:56.000000000 +0200
@@ -1147,10 +1147,10 @@
                imp_dbh->server[63] = 0;
        }
 
-       strncpy(imp_dbh->uid, uid, 32);
-       imp_dbh->uid[31] = 0;
-       strncpy(imp_dbh->pwd, pwd, 32);
-       imp_dbh->pwd[31] = 0;
+       strncpy(imp_dbh->uid, uid, MAX_LOGIN_STR_SZ);
+       imp_dbh->uid[MAX_LOGIN_STR_SZ - 1] = 0;
+       strncpy(imp_dbh->pwd, pwd, MAX_LOGIN_STR_SZ);
+       imp_dbh->pwd[MAX_LOGIN_STR_SZ - 1] = 0;
 
        sv_setpv(DBIc_ERRSTR(imp_dbh), "");
 

Reply via email to