Commit Graph
665 Commits
Author SHA1 Message Date
bokic bb08d92bfb FIX: mdb-sql crashed with SIGSEGV in _IO_vfprintf_internal() on amd64
https://bugs.launchpad.net/ubuntu/+source/mdbtools/+bug/1227033
2013-10-06 06:23:35 +02:00
Nirgal Vourgère a7a39a34ee Refresh help makefiles from gnome-doc-utils 2013-08-11 14:02:02 +02:00
Nirgal Vourgère 4a3f3492cd Prints "file not found" when that happens
... rather than the obscure "Can't alloc filename"
2013-07-18 15:21:14 +02:00
Nirgal Vourgère 95b8b750bc Droped autoconf hacks caused by AC_CONFIG_HEADERS 2013-07-15 02:55:57 +02:00
Nirgal Vourgère 7841d30d43 Revert use of config.h
Revert
7162e8db74
088493d499

And drop AC_CONFIG_HEADERS so that config goes though the command line.
No longer generating config.h, update .gitignore
2013-07-15 02:42:12 +02:00
Nirgal Vourgère 05980343ec Change to recommanded m4/-style small files 2013-07-15 00:30:21 +02:00
Nirgal Vourgère a63692312c Drop autogen.sh: Do use autoconf
Automake is changing and some of the stuff in autogen.sh is expected to fail
soon:
https://www.gnu.org/software/automake/manual/html_node/Future-of-aclocal.html

"autoreconf -if" will overwrite the INSTALL file, so its content is now in the
README file.

Added NEWS warning

Adjusted .gitignore
2013-07-14 21:35:06 +02:00
Nirgal Vourgère 5312060544 Changed gmdb2 output filenames to textentries
GtkFileChooserButton was cripled by gtk developers so that it now only support
selecting an existing file for overwrite.
https://bugzilla.gnome.org/show_bug.cgi?id=157384

TextEntries is really not user friendly, but it's better than forced overwrite.
2013-07-14 19:06:59 +02:00
Nirgal Vourgère 088493d499 Update autoconf/automake standards
Generated files config.guess config.sub depcomp install-sh ltmain.sh missing
and ylwrap have been moved to build-aux/

Ran autoupdate

Replaced AC_TRY_LINK/AC_TRY_COMPILE by AC_LINK_IFELSE/AC_COMPILE_IFELSE

Droped -I$(top_srcdir)/include from CFLAGS since AC_CONFIG_HEADERS already
adds the -I

Fixed bison detection

Added AM_PROG_AR as required by autoreconf -i -Wall

Updated NEWS and .gitignore
2013-07-09 18:39:03 +02:00
Nirgal Vourgère a021708dae Move the ODBC wide support in its own file
Enabling wide functions can break ascii one, like DriveConnect()
2013-07-09 00:54:03 +02:00
Nirgal Vourgère c908a4f4de ODBC GetData include \0 if fCType==SQL_C_CHAR 2013-07-08 17:12:47 +02:00
Nirgal Vourgère 3bdff87b9a ODBC GetData: Add support for a few fCType codes 2013-07-08 17:06:06 +02:00
Nirgal Vourgère 06ea2517e9 ODBC bug fix: reset length location on rebind 2013-07-07 19:42:49 +02:00
Nirgal Vourgère 00a66cc57f ODBC
Check column index ranges
Don't write \0 past buffer in column names
Warn if column name trucated
Repport driver version
2013-07-07 14:26:08 +02:00
Nirgal Vourgère b728fc1e45 Drop versioning from libmdbodbc
Do use libmdbodbc.so, this is a plugin, not a versioned library
2013-07-05 00:30:43 +02:00
Nirgal Vourgère 7495034eef Fix FSF address in headers 2013-07-04 13:50:33 +02:00
Nirgal Vourgère ca395d8537 Added --disable-man configure option
You want that if you don't have txt2man or just are not interrested
in manuals.
2013-07-04 13:22:52 +02:00
Nirgal Vourgère 36a28cdfdb Drop old gmdb from repository 2013-07-04 12:05:40 +02:00
Nirgal Vourgère 603bfa365a Fix warning if large file support is enabled 2013-07-04 11:19:11 +02:00
Nirgal Vourgère 7162e8db74 Include config.h in all .c files
Need to be the first file since it may define large files support
and other options.
2013-07-04 10:53:13 +02:00
Nirgal Vourgère 66b87caf26 ODBC memory management
Check proper closure sequence of Statements/Connections/Env

SQLDisconnect now closes automatically all attached statements.
2013-07-03 19:32:53 +02:00
Nirgal Vourgère aac9c61536 Moved ODBC ConnectParams into struct _hdbc
So now struct _hdbc contains the real allocated data.
SQLAllocConnect doesn't hack it anymore with its own stucture.
2013-07-03 13:39:08 +02:00
Nirgal Vourgère eefddaffcc Don't distribute mdbprivate.h and mdbodbc.h
mdbprivate is.... private.

mdbodbc.h has no reason to be public: People who want to use the plugin
should use the public odbc.h headers. And having this private will permit
hdbc cleanup.
2013-07-03 11:59:28 +02:00
Nirgal Vourgère 54a036d8b2 Merge of HACKING from jahlborn 2013-07-01 14:41:12 +02:00
James Ahlborn 314e6040c5 adds info about unicode compression of memo fields 2013-06-30 21:16:57 -04:00
James Ahlborn e49fd5ab2e adds info about the extra data at the end of the table definition. 2013-06-30 21:12:10 -04:00
Nirgal Vourgère 6b24b25454 include odbcinstext.h in connectparams.c
This is possible since unixodbc version 2.2.10 as they fixed the including
of local files from public headers.
2013-06-30 15:29:16 +02:00
Nirgal Vourgère 5cc23dd447 Added version in NEWS
This was really old news :)
2013-06-29 17:58:15 +02:00
Nirgal Vourgère 6ef7da0597 Disabled schema comments for mysql backend
They were using an incorrect syntax
2013-06-29 12:13:09 +02:00
Nirgal Vourgère 6938e3c128 Changed the gmdb warning when SQL is disabled
--enable-sql option is no more.
2013-06-28 20:15:39 +02:00
Nirgal Vourgère 7a1637982c Fix build if yacc is missing 2013-06-28 20:07:44 +02:00
Nirgal Vourgère 8f0f167ab2 Memory leak fix
Free temporary variable in mdb_print_indexes
2013-06-28 17:54:30 +02:00
Nirgal Vourgère 687eeebe78 Memory leak fix
Need to free previous backend name when changing it.
2013-06-28 16:41:29 +02:00
Nirgal Vourgère 0196d34d7b __attribute__ change into macro
Makes it easier to port to another compiler.
Thanks Jimmy Taker
2013-06-28 01:51:52 +02:00
Nirgal Vourgère 365f7959ed Fixed password decoding
Thanks Jimmy Taker compilation warning.
2013-06-27 23:46:46 +02:00
William Rogers 0bbe5d3ee6 Memory leak fix
Free the col->sargs
2013-06-27 20:58:43 +02:00
William Rogers 1d39126de6 Memory leak wrong fix
Free col->sargs
Note this patch causes SEGV
2013-06-27 16:09:53 +02:00
Nirgal Vourgère a69281e7bf Fix memory leak
Free sql->cur-table->sargs_tree
Thanks William Rogers.
2013-06-27 13:09:53 +02:00
Nirgal Vourgère 577abe09bf Code factorisation
Call mdb_sql_reset from mdb_sql_exit
This does some harmless extra stuff, like reseting column counts.
Not worth the trouble to code it twice.
2013-06-27 12:28:26 +02:00
William Rogers 04daf7cab5 Memory leak fix
Need to free parent in mdb_sql_free_tree
2013-06-27 11:13:39 +02:00
Nirgal Vourgère 37cd3ecd2c Fix SEGV if mdb-array is given a bad filename
See bug repport at:
http://www.forallsecure.com/bug-reports/d256a6f86b05b4ca0a1d7097b64e7c6bcd98de6d/
2013-06-26 21:08:24 +02:00
William Rogers ecc72f8faf mdb_sql_bind_all already in mdb_sql_run_query 2013-06-26 12:13:44 +02:00
William Rogers 6043e22a43 Memory leak fix in odbc
Free the stmt->bind_head list on Stmt
Reset row_affected on FreeStmt
2013-06-26 11:33:26 +02:00
William Rogers 6326e54e82 Fix mem leak in SQLGetData
Free temporary string when we are past result length and we return SQL_NO_DATA
2013-06-26 10:13:05 +02:00
Nirgal Vourgère ee1978161c Check outpout buffers in ODBC SQLGetInfo 2013-06-26 00:41:12 +02:00
William Rogers fd6e52f9bd Fixed MDBProps memory leaks 2013-06-25 21:33:38 +02:00
William Rogers 23942c19d3 Update _SQLGetData - Was incorrectly attempting to validate input of an output only parameter
According to the spec, pcbValue is designated as an output only variable, so there is no need to validate any incoming values.

Some packages do not initialize this variable before passing it into the function call; this will randomly result in an improperly thrown error.

Removed the input validation.
2013-06-23 18:28:43 +02:00
tyzhaoqi 9cd05ffdcc Added missing break in switch/case
That missing break is not just a memory leak:
It results in incorrect call to mdb_unicode2ascii for binary data!
I suspect that is what is causing segfault on some db as repported on
https://github.com/brianb/mdbtools/issues/19
2013-06-23 17:56:53 +02:00
rogerswb 40d1ecd11f Update _SQLGetData - Was incorrectly attempting to validate input of an output only parameter
According to the spec, pcbValue is designated as an output only variable, so there is no need to validate any incoming values.

Some packages do not initialize this variable before passing it into the function call; this will randomly result in an improperly thrown error.

Removed the input validation.
2013-05-23 14:58:19 -05:00
Jimmytaker 46005ae009 MDB_DEPRECATED redefined, Constructor MACRO, generate_table_schema changed to not static, date_fmt to ISODate
__attribute__ does not exist in Visual Studio. Therefore replaced wherever it appeared with a macro:
Redefines MDB_DEPRECATED to support Visual Studio
Define a Constructor MACRO so that __attribute__((constructor/destructor)) behavior is achieved in Visual Studio.

Just using generate_table_schema through mdb_print_schema deletes the purpose of a very good tool. generate_table_schemas is a rewrite of generate_table_schema but sends the data to a char* instead of FILE*. There is NO fmemopen() or similar in Visual Studio, so there is NO way to access memory through a FILE* except for first writing to the disk and then reading from the disk in memory.

I cannot suggest how to handle the case when td == 0 for the dates. The databases I work with often have just 00:00:00 in the DateTime column which is not consistent with the rest of the column either, but I have to deal with it somehow.

Leaving void* where char* is needed as a function parameter returns a compilation error in Visual Studio.
2013-01-14 19:27:53 +01:00