/[v1]/trunk/c++/src/dbapi/driver/ftds100/freetds/tds/login.c
ViewVC logotype

Log of /trunk/c++/src/dbapi/driver/ftds100/freetds/tds/login.c

Parent Directory Parent Directory | Revision Log Revision Log


Links to HEAD: (view) (download) (as text) (annotate)
Sticky Revision:

Revision 93391 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Apr 8 13:33:55 2021 UTC (3 years, 1 month ago) by ucko
File length: 36615 byte(s)
Diff to previous 89713
tds_connect: Leave the original context's error handler alone.

Conditionalize out the code that temporarily set the socket's original
context's error handler to NULL during version probing.  The relevant
socket already uses a temporary copy of that context with a suitable
custom error handler, so the only potential usage of this context will
be from other threads that should be able to carry on independently.
JIRA: CXX-4368.

Revision 89713 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Apr 17 12:50:59 2020 UTC (4 years, 1 month ago) by ucko
File length: 36576 byte(s)
Diff to previous 80707
FreeTDS: Make log elision around logins properly thread-safe.

Leave the global tds_write_dump toggle alone and supplement it with a
thread-local tdsdump_elided(_verN) variable.  JIRA: CXX-11303.

Revision 80707 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Dec 28 19:07:38 2017 UTC (6 years, 4 months ago) by ucko
File length: 36668 byte(s)
Diff to previous 80696
login.c (tds_connect): Skip non-TCP tries to connect to a host:port.

TRUNK-0.95: 553080, 553092, 553115, 553191.  AUTHOR: satskyse.
JIRA: CXX-9729.

Revision 80696 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Dec 28 19:02:42 2017 UTC (6 years, 4 months ago) by ucko
File length: 35221 byte(s)
Diff to previous 80681
login.c (SET_FIELD_DSTR, for tds7_send_login): Cap field lengths at 128.

MS SQL Server will silently drop the connection if any exceed that limit.

TRUNK-0.95: 490374.  JIRA: CXX-9729.

Revision 80681 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Dec 28 18:54:20 2017 UTC (6 years, 4 months ago) by ucko
File length: 35149 byte(s)
Diff to previous 80680
Report system errors' descriptions to ctlib clients.

* tds.h (TDSMESSAGE): Add an osstr field.
* ctutil.c (_ct_handle_client_message): Propagate it to osstring(len).
* tds/login.c (tds_save): Clear osstr to avoid invalid reads when
  trying to connect to a dead server.
* tds/ncbi_strerror.c: Clone from the connect tree.
* tds/util.c (tdserror): Populate the osstr field; clean it when done.

TRUNK-0.95: 487512.  AUTHOR: ucko.
TRUNK-0.95: 530901, 530912.  AUTHOR: lavr.
TRUNK-0.95: 546039.  AUTHOR: satskyse.
JIRA: CXX-9729.

Revision 80680 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Dec 28 18:51:16 2017 UTC (6 years, 4 months ago) by ucko
File length: 35113 byte(s)
Diff to previous 80679
Address FreeTDS 1.0 compiler warnings.

* Harmonize type usage, via explicit casts where necessary (and safe).
  In particular, ensure that upstream tests' tds_thread_proc routines
  know to return DWORD rather than void* on Windows.
* Ensure that any headers checking (TDS_)HAVE_* #include <config.h> first.
* Keep static assertions warning-free by using _Static_assert where
  available.
* Ensure that members of types that should be unhidden have unhidden
  forward declarations; likewise for their members, recursively.
* Remove (comment out) unused variables and constants.
* Express -2**31 and -2**63 in a manner all compilers accept happily.
* For LLVM Clang, substitute __attribute__((visibility("default")))
  for __attribute__((externally_visible)), which it doesn't support.
* Add no-op default: cases to switch statements that don't explicitly
  cover all of TDS_SERVER_TYPE.
* ctlib.h: #define _CS_CURS_TYPE_* to TDS_CURSOR_STATE_* rather than
  (typelessly) duplicating their values.
* thread.h: Correct tds_thread_proc and TDS_THREAD_PROC_DECLARE; Windows
  threads are expected to return DWORD, not void*.
* dblib/bcp.c (_bcp_get_col_data): Remove a redundant test for
  non-negativity.
* dblib/dblib.c: Express -2?\194?\179?\194?\185 in a manner all compilers accept happily.
* odbc/unittests/attributes.c: Tell the compiler fatal() will never return.
* odbc/unittests/common.h: When the ODBC 3 API is available, favor
  SQLSetStmtAttr over SQLSetStmtOption, which is deprecated.
* tds/convert.c: Rename the string_to_result function to ensure IDEs
  don't conflate it with the identically named wrapper macro.
* tds/gssapi.c: Suppress GSSAPI deprecation warnings on Mac OS X.
* tds/md[45].c: Use TDS_PUT_(U)A4 to populate word32 targets cleanly.
* tds/query.c: #include <sys/socket.h> if available, for send().
* tds/sspi.c: Define _WIN32_WINNT before <config.h>, which might
  otherwise supply a slightly different definition.

TRUNK-0.95: 487511, 554113.  JIRA: CXX-9729.

Revision 80679 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Dec 28 18:50:12 2017 UTC (6 years, 4 months ago) by ucko
File length: 35055 byte(s)
Diff to previous 80648
Upon logging in, restore previous dump state (not necessarily on).

* tds/log.c (tdsdump_state): New function to query logging status.
* tds/login.c (tds7_send_login): Consult it, rather than
  unconditionally reenabling logging when done.

TRUNK-0.95: 487510.  JIRA: CXX-9729.

Revision 80648 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Dec 28 18:32:08 2017 UTC (6 years, 4 months ago) by ucko
File length: 34938 byte(s)
Diff to previous 80642
Enable automatic TDS protocol version detection.

* ct.c (ct_con_props): Treat CS_TDS_VERSION 0 as requesting autodetection.
* tds/login.c (tds_connect): Have autodetection always skip protocol versions
  7.2 and higher, which yield different behavior and in particular break code
  that expects to receive text pointers for image and (n)text fields for use
  with WRITETEXT BULK (via ct_send_data).  Always reset block size between
  probes to accommodate servers (notably Sybase 12.5) that don't support
  large packets.
* tds/mem.c (tds_alloc_connection): default tds_version to 0.
* Let upstream unit tests rely on autodetection.

TRUNK-0.95: 487480.  JIRA: CXX-9729.

Revision 80642 - (view) (download) (as text) (annotate) - [select for diffs]
Added Thu Dec 28 16:33:56 2017 UTC (6 years, 4 months ago) by ucko
File length: 34651 byte(s)
Add upstream FreeTDS files from Branch-1_00, as of 2017-12-28.

Incorporate fixes that didn't make it into the release (many of which
would otherwise have wound up coming in as patches).
Upstream revision ID: R1_00-80-gd40d5e91 (last commit 2017-11-29).

JIRA: CXX-9729.

This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, enter a numeric revision.

  Diffs between and
  Type of Diff should be a

NCBI Systems Team">NCBI Systems Team
ViewVC Help
Powered by ViewVC 1.1.20  

HHS Vulnerability Disclosure