aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/libpq/fe-connect.c
Commit message (Collapse)AuthorAge
* Remove unsafe calling of WSAStartup and WSACleanup from DllMain. Move theMagnus Hagander2007-03-08
| | | | | | | inline cleanup call around so it will be called in the right order, and be called on errors. Per report from Tokuharu Yuzawa.
* If SSL negotiation fails and SSLMODE is 'prefer', then retry without SSL.Tom Lane2006-11-21
| | | | | | | Negotiation failure is only likely to happen if one side or the other is misconfigured, eg. bad client certificate. I'm not 100% convinced that a retry is really the best thing, hence not back-patching this fix for now. Per gripe from Sergio Cinos.
* Message style improvementsPeter Eisentraut2006-10-06
|
* pgindent run for 8.2.Bruce Momjian2006-10-04
|
* Remove separate strdup.h header file; it's redundant with port.h.Tom Lane2006-09-27
|
* Fix some uses of str[n]casecmp that should be pg_str[n]casecmp,Tom Lane2006-09-15
| | | | per Magnus.
* Allow LDAP lookups from pg_service.conf.Bruce Momjian2006-07-27
| | | | Albe Laurenz
* Prepare code to be built by MSVC:Bruce Momjian2006-06-07
| | | | | | | | | | o remove many WIN32_CLIENT_ONLY defines o add WIN32_ONLY_COMPILER define o add 3rd argument to open() for portability o add include/port/win32_msvc directory for system includes Magnus Hagander
* Modify libpq's string-escaping routines to be aware of encoding considerationsTom Lane2006-05-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and standard_conforming_strings. The encoding changes are needed for proper escaping in multibyte encodings, as per the SQL-injection vulnerabilities noted in CVE-2006-2313 and CVE-2006-2314. Concurrent fixes are being applied to the server to ensure that it rejects queries that may have been corrupted by attempted SQL injection, but this merely guarantees that unpatched clients will fail rather than allow injection. An actual fix requires changing the client-side code. While at it we have also fixed these routines to understand about standard_conforming_strings, so that the upcoming changeover to SQL-spec string syntax can be somewhat transparent to client code. Since the existing API of PQescapeString and PQescapeBytea provides no way to inform them which settings are in use, these functions are now deprecated in favor of new functions PQescapeStringConn and PQescapeByteaConn. The new functions take the PGconn to which the string will be sent as an additional parameter, and look inside the connection structure to determine what to do. So as to provide some functionality for clients using the old functions, libpq stores the latest encoding and standard_conforming_strings values received from the backend in static variables, and the old functions consult these variables. This will work reliably in clients using only one Postgres connection at a time, or even multiple connections if they all use the same encoding and string syntax settings; which should cover many practical scenarios. Clients that use homebrew escaping methods, such as PHP's addslashes() function or even hardwired regexp substitution, will require extra effort to fix :-(. It is strongly recommended that such code be replaced by use of PQescapeStringConn/PQescapeByteaConn if at all feasible.
* Fix typo in comment.Alvaro Herrera2006-05-19
|
* Remove canonicalize_path() call for .pgpass socket directory comparison;Bruce Momjian2006-05-18
| | | | not worth adding path.c to libpq.
* Allow the .pgpass hostname to match the default socket directory, asBruce Momjian2006-05-17
| | | | well as a blank pghost.
* Improve parser so that we can show an error cursor position for errorsTom Lane2006-03-14
| | | | | | | | | | | during parse analysis, not only errors detected in the flex/bison stages. This is per my earlier proposal. This commit includes all the basic infrastructure, but locations are only tracked and reported for errors involving column references, function calls, and operators. More could be done later but this seems like a good set to start with. I've also moved the ReportSyntaxErrorPosition logic out of psql and into libpq, which should make it available to more people --- even within psql this is an improvement because warnings weren't handled by ReportSyntaxErrorPosition.
* Update copyright for 2006. Update scripts.Bruce Momjian2006-03-05
|
* Add positive defense against trying to connect when the connectionTom Lane2006-02-13
| | | | | | option state hasn't been fully set up. This is possible via PQreset() and might occur in other code paths too, so a state flag seems the most robust solution. Per report from Arturs Zoldners.
* Cosmetic code cleanup: fix a bunch of places that used "return (expr);"Neil Conway2006-01-11
| | | | | | rather than "return expr;" -- the latter style is used in most of the tree. I kept the parentheses when they were necessary or useful because the return expression was complex.
* Re-run pgindent, fixing a problem where comment lines after a blankBruce Momjian2005-11-22
| | | | | | | | | comment line where output as too long, and update typedefs for /lib directory. Also fix case where identifiers were used as variable names in the backend, but as typedefs in ecpg (favor the backend for indenting). Backpatch to 8.1.X.
* Clean up libpq's pollution of application namespace by renaming theTom Lane2005-10-17
| | | | | | exported routines of ip.c, md5.c, and fe-auth.c to begin with 'pg_'. Also get rid of the vestigial fe_setauthsvc/fe_getauthsvc routines altogether.
* Standard pgindent run for 8.1.Bruce Momjian2005-10-15
|
* Don't need gettext calls around debug messages.Peter Eisentraut2005-09-26
|
* The attached patch updates the thread test program to run stand-alone onBruce Momjian2005-08-23
| | | | | | | | Windows. The test itself is bypassed in configure as discussed, and libpq has been updated appropriately to allow it to build in thread-safe mode. Dave Page
* Back out incorrect commit.Bruce Momjian2005-08-23
|
* Fix function name.Bruce Momjian2005-08-23
|
* EINTR return from connect() should be treated exactly the same asTom Lane2005-08-11
| | | | | EINPROGRESS, according to Florian Hars. I'm not completely convinced but the spec does seem to read that way.
* Remove unintended file change.Bruce Momjian2005-08-09
|
* Clarify wal_sync_method options in documentation.Bruce Momjian2005-08-09
|
* Fix libpq memory leak during PQreset() --- closePGconn() was notTom Lane2005-07-13
| | | | freeing all transient state of the PGconn object.
* Remove support for Kerberos V4. It seems no one is using this, it hasNeil Conway2005-06-27
| | | | | some security issues, and upstream has declared it "dead". Patch from Magnus Hagander, minor editorialization from Neil Conway.
* Cleanup for Win32 compile.Bruce Momjian2005-06-19
| | | | Andreas Pflug
* This patch removes some old code from libpq that implements a URI-likeNeil Conway2005-06-12
| | | | | | syntax for database connection parameters. It has been inside an #ifdef NOT_USED block since 2001 or so and is marked as "broken", so I don't think it is likely to be rehabilitated any time soon.
* libpq was not consistently checking for memory allocation failures. ThisNeil Conway2005-06-12
| | | | | | | patch adds missing checks to the call sites of malloc(), strdup(), PQmakeEmptyPGresult(), pqResultAlloc(), and pqResultStrdup(), and updates the documentation. Per original report from Volkan Yazici about PQmakeEmptyPGresult() not checking for malloc() failure.
* Remove unneeded variable test, per Tom.Bruce Momjian2005-06-10
|
* Add the "PGPASSFILE" environment variable to specify to the passwordBruce Momjian2005-06-10
| | | | | | file. Andrew Dunstan
* Allow kerberos name and username case sensitivity to be specified fromBruce Momjian2005-06-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | postgresql.conf. --------------------------------------------------------------------------- Here's an updated version of the patch, with the following changes: 1) No longer uses "service name" as "application version". It's instead hardcoded as "postgres". It could be argued that this part should be backpatched to 8.0, but it doesn't make a big difference until you can start changing it with GUC / connection parameters. This change only affects kerberos 5, not 4. 2) Now downcases kerberos usernames when the client is running on win32. 3) Adds guc option for "krb_caseins_users" to make the server ignore case mismatch which is required by some KDCs such as Active Directory. Off by default, per discussion with Tom. This change only affects kerberos 5, not 4. 4) Updated so it doesn't conflict with the rendevouz/bonjour patch already in ;-) Magnus Hagander
* Add comments on WSAStartup usage.Bruce Momjian2005-05-05
|
* Add WSACleanup() for Win32 socket cleanup.Bruce Momjian2005-05-05
| | | | Jason Erickson
* Kerberos fixes from Magnus Hagander --- in theory Kerberos 5 authTom Lane2005-03-25
| | | | | | should work on Windows now. Also, rename set_noblock to pg_set_noblock; since it is included in libpq, the former name polluted application namespace.
* Use _() macro consistently rather than gettext(). Add translationBruce Momjian2005-02-22
| | | | macros around strings that were missing them.
* Use SHGetFolderPath instead of SHGetSpecialFolderPath to find theTom Lane2005-01-26
| | | | APPDATA directory on Windows. Magnus Hagander
* Change Win32 client configuration files from *.txt to *.conf.Bruce Momjian2005-01-14
|
* Un-break MSVC build, per Andrew Dunstan.Tom Lane2005-01-10
|
* Minor mop-up for Windows home-directory stuff, per Magnus.Tom Lane2005-01-06
|
* Instead of a bare recv() to read the server's response to an SSLTom Lane2005-01-06
| | | | | | | request packet, use pqReadData(). This has the same effect since conn->ssl isn't set yet and we aren't expecting more than one byte. The advantage is that we will correctly detect loss-of-connection instead of going into an infinite loop. Per report from Hannu Krosing.
* Adjust lookup of client-side profile files (.pgpass and so on) as perTom Lane2005-01-06
| | | | | | discussion on pgsql-hackers-win32 list. Documentation still needs to be tweaked --- I'm not sure how to refer to the APPDATA folder in user documentation.
* Make the various places that determine the user's "home directory"Tom Lane2005-01-06
| | | | | | | | consistent. On Unix we now always consult getpwuid(); $HOME isn't used at all. On Windows the code currently consults $USERPROFILE, or $HOME if that's not defined, but I expect this will change as soon as the win32 hackers come to a consensus. Nothing done yet about changing the file names used underneath $USERPROFILE.
* Clean up code in libpq that obtains user's home directory: make a singleTom Lane2005-01-04
| | | | | | subroutine that can hide platform dependencies. The WIN32 path is still a stub, but I await a fix from one of the win32 hackers. Also clean up unnecessary #ifdef WIN32 ugliness in a couple of places.
* Tag appropriate files for rc3PostgreSQL Daemon2004-12-31
| | | | | | | | Also performed an initial run through of upgrading our Copyright date to extend to 2005 ... first run here was very simple ... change everything where: grep 1996-2004 && the word 'Copyright' ... scanned through the generated list with 'less' first, and after, to make sure that I only picked up the right entries ...
* Make libpq default to localhost connections on machines without Unix-domainTom Lane2004-12-28
| | | | | sockets, rather than failing as it formerly did. Revert the thereby-obsoleted patch to make psql supply the localhost default.
* Code review for recent libpq changes. Be more careful about errorTom Lane2004-12-02
| | | | | | handling in SIGPIPE processing; avoid unnecessary pollution of application link-symbol namespace; spell 'pointer to function' in the conventional way.
* Rework libpq threaded SIGPIPE handling to avoid interference withBruce Momjian2004-12-02
| | | | | | calling applications. This is done by blocking sigpipe in the libpq thread and using sigpending/sigwait to possibily discard any sigpipe we generated.