aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/libpq/fe-auth.c
Commit message (Collapse)AuthorAge
...
* > I've now tested this patch at home w/ 8.2HEAD and it seems to fix theBruce Momjian2006-02-12
| | | | | | | | | | | | | | | | | | | | | | | > bug. I plan on testing it under 8.1.2 at work tommorow with > mod_auth_krb5, etc, and expect it'll work there. Assuming all goes > well and unless someone objects I'll forward the patch to -patches. > It'd be great to have this fixed as it'll allow us to use Kerberos to > authenticate to phppgadmin and other web-based tools which use > Postgres. While playing with this patch under 8.1.2 at home I discovered a mistake in how I manually applied one of the hunks to fe-auth.c. Basically, the base code had changed and so the patch needed to be modified slightly. This is because the code no longer either has a freeable pointer under 'name' or has 'name' as NULL. The attached patch correctly frees the string from pg_krb5_authname (where it had been strdup'd) if and only if pg_krb5_authname returned a string (as opposed to falling through and having name be set using name = pw->name;). Also added a comment to this effect. Please review. Stephen Frost (sfrost@snowman.net) wrote:
* Rename pg_make_encrypted_password to PQencryptPassword.Peter Eisentraut2005-12-26
|
* Add an officially exported libpq function to encrypt passwords, andTom Lane2005-12-23
| | | | | modify the previous \password patch to use it instead of depending on a not-officially-exported function. Per discussion.
* 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.
* I have applied the following patch to document PQinitSSL() andBruce Momjian2005-10-24
| | | | | | | | | | | PQregisterThreadLock(). I also remove the crypt() mention in the libpq threading section and added a single sentence in the client-auth manual page under crypt(). Crypt authentication is so old now that a separate paragraph about it seemed unwise. I also added a comment about our use of locking around pqGetpwuid().
* 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
|
* Fix Kerberos authentication in wake of virtual-hosts changes --- needTom Lane2005-10-08
| | | | | | | to call krb5_sname_to_principal() always. Also, use krb_srvname rather than the hardwired string 'postgres' as the appl_version string in the krb5_sendauth/recvauth calls, to avoid breaking compatibility with PG 8.0. Magnus Hagander
* Fix a theoretical memory leak in pg_password_sendauth(). If the firstNeil Conway2005-06-30
| | | | | | | | malloc() succeeded but the second failed, the buffer allocated by the first malloc() would be leaked. Fix this by allocating both buffers via a single malloc(), as suggested by Tom. Per Coverity static analysis performed by EnterpriseDB.
* 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.
* 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
* 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.
* Add conditional inclusion of <com_err.h> to support old 'heimdal'Tom Lane2005-01-12
| | | | version of Kerberos. Per report from Reinhard Max.
* 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 ...
* Remove direct inclusions of <com_err.h> as well as configure test forTom Lane2004-12-20
| | | | | | | its presence. This amounts to desupporting Kerberos 5 releases 1.0.*, which is small loss, and simplifies use of our Kerberos code on platforms with Red-Hat-style include file layouts. Per gripe from John Gray and followup discussion.
* Get rid of perror(), substitute some better phrased error messages.Peter Eisentraut2004-11-09
| | | | malloc() doesn't set errno, so most uses were buggy anyway.
* Allow pg_ctl to determine the server is up when getting a request for aBruce Momjian2004-10-16
| | | | | | | | password. Make password error message a #define and use it consistently. Sean Chittenden
* Revert patch that removed BUFSIZ usage. The memory has to hold theBruce Momjian2004-09-28
| | | | structures plus pointers used by the structure.
* Remove use of large BUFSIZ for buffers and use the proper struct sizes.Bruce Momjian2004-09-27
| | | | This greatly helps threaded libpq programs.
* Update copyright to 2004.Bruce Momjian2004-08-29
|
* Add thread locking to SSL and Kerberos connections.Bruce Momjian2004-03-24
| | | | | | | I have removed the docs mentioning that SSL and Kerberos are not thread-safe. Manfred Spraul
* More janitorial work: remove the explicit casting of NULL literals to aNeil Conway2004-01-07
| | | | | | | | pointer type when it is not necessary to do so. For future reference, casting NULL to a pointer type is only necessary when (a) invoking a function AND either (b) the function has no prototype OR (c) the function is a varargs function.
* Dept. of third thoughts: in fact, libpq should support SCM_CREDS challengeTom Lane2003-12-20
| | | | | even when HAVE_GETPEEREID is defined, else it will be unable to connect to pre-7.4 backends that are using IDENT authentication.
* Fix broken IDENT support for FreeBSD (appears to have been broken byTom Lane2003-12-20
| | | | | ill-considered conditional logic in getpeereid patch of 3-Dec-2002). Per bug #1021.
* $Header: -> $PostgreSQL Changes ...PostgreSQL Daemon2003-11-29
|
* Cast field-length variables used in printf to int, because sometimesPeter Eisentraut2003-11-26
| | | | they might be of a wider type.
* Remove socket credentials defines not referenced.Bruce Momjian2003-10-25
|
* Update copyrights to 2003.Bruce Momjian2003-08-04
|
* pgindent run.Bruce Momjian2003-08-04
|
* > This change (I'm sure this will wrap poorly -- sorry):Bruce Momjian2003-06-25
| | | | | | | | | | | | | | | | | | | > http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/include/libpq/pqcomm.h.diff?r1=1.85&r2=1.86 > > modified SockAddr, but no corresponding change was made here > (fe-auth.c:612): > > case AUTH_REQ_KRB5: > #ifdef KRB5 > if (pg_krb5_sendauth(PQerrormsg, conn->sock, &conn->laddr.in, > &conn->raddr.in, > hostname) != STATUS_OK) > > It's not obvious to me what the change ought to be though. This patch should hopefully fix both kerberos 4 and 5. Kurt Roeckx
* Make libpq thread-safe with configure --with-threads option.Bruce Momjian2003-06-14
| | | | Lee Kindness
* libpq can now talk to either 3.0 or 2.0 protocol servers. It first triesTom Lane2003-06-08
| | | | | | | protocol 3, then falls back to 2 if postmaster rejects the startup packet with an old-format error message. A side benefit of the rewrite is that SSL-encrypted connections can now be made without blocking. (I think, anyway, but do not have a good way to test.)
* Revert kerberos code breakage.Tom Lane2003-05-16
|
* Allow Win32 to compile under MinGW. Major changes are:Bruce Momjian2003-05-15
| | | | | | | | | | | | | | | Win32 port is now called 'win32' rather than 'win' add -lwsock32 on Win32 make gethostname() be only used when kerberos4 is enabled use /port/getopt.c new /port/opendir.c routines disable GUC unix_socket_group on Win32 convert some keywords.c symbols to KEYWORD_P to prevent conflict create new FCNTL_NONBLOCK macro to turn off socket blocking create new /include/port.h file that has /port prototypes, move out of c.h new /include/port/win32_include dir to hold missing include files work around ERROR being defined in Win32 includes
* Second round of FE/BE protocol changes. Frontend->backend messages nowTom Lane2003-04-19
| | | | have length counts, and COPY IN data is packetized into messages.
* First phase of FE/BE protocol modifications: new StartupPacket layoutTom Lane2003-04-17
| | | | | | with variable-width fields. No more truncation of long user names. Also, libpq can now send its environment-variable-driven SET commands as part of the startup packet, saving round trips to server.
* This patch fixes a bunch of spelling mistakes in comments throughout theTom Lane2003-03-10
| | | | | | PostgreSQL source code. Neil Conway
* Guard against array overrun, per report from Yichen Xie. This caseTom Lane2003-01-29
| | | | | can only occur if the constant DEFAULT_CLIENT_AUTHSVC is given a bogus value, so it doesn't seem worth back-patching, but I'll fix it in HEAD.
* Deal with cases where getpeereid _and_ another creditial method isBruce Momjian2002-12-03
| | | | supported.
* pgindent run.Bruce Momjian2002-09-04
|
* I checked all the previous string handling errors and most of them wereBruce Momjian2002-09-02
| | | | | | | | | | | | | | | already fixed by You. However there were a few left and attached patch should fix the rest of them. I used StringInfo only in 2 places and both of them are inside debug ifdefs. Only performance penalty will come from using strlen() like all the other code does. I also modified some of the already patched parts by changing snprintf(buf, 2 * BUFSIZE, ... style lines to snprintf(buf, sizeof(buf), ... where buf is an array. Jukka Holappa
* Remove support for version-0 FE/BE protocol, per pghackers discussion.Tom Lane2002-08-29
| | | | This breaks support for 6.2 or older client libraries.
* Hello, i noticed that win32 native stopped working/compiling after the SSL mergeBruce Momjian2002-07-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | . So i took the opportunity to fix some stuff: 1. Made the thing compile (typos & needed definitions) with the new pqsecure_* s tuff, and added fe-secure.c to the win32.mak makefile. 2. Fixed some MULTIBYTE compile errors (when building without MB support). 3. Made it do that you can build with debug info: "nmake -f win32.mak DEBUG=1". 4. Misc small compiler speedup changes. The resulting .dll has been tested in production, and everything seems ok. I CC:ed -hackers because i'm not sure about two things: 1. In libpq-int.h I typedef ssize_t as an int because Visual C (v6.0) doesn't de fine ssize_t. Is that ok, or is there any standard about what type should be use d for ssize_t? 2. To keep the .dll api consistent regarding MULTIBYTE I just return -1 in fe-connect.c:PQsetClientEncoding() instead of taking away the whole function. I wonder if i should do any compares with the conn->client_encoding and return 0 if not hing would have changed (if so how do i check that?). Regards Magnus Naeslund
* Update copyright to 2002.Bruce Momjian2002-06-20
|
* Katherine Ward wrote:Jan Wieck2002-06-11
| | | | | | | | | | | | | | > Changes to avoid collisions with WIN32 & MFC names... > 1. Renamed: > a. PROC => PGPROC > b. GetUserName() => GetUserNameFromId() > c. GetCurrentTime() => GetCurrentDateTime() > d. IGNORE => IGNORE_DTF in include/utils/datetime.h & utils/adt/datetim > > 2. Added _P to some lex/yacc tokens: > CONST, CHAR, DELETE, FLOAT, GROUP, IN, OUT Jan
* Remove reference to NAMEDATALEN, which wasn't necessary anyway.Peter Eisentraut2002-04-24
|
* Heimdal support (Kerberos V implementation from KTH)Peter Eisentraut2002-02-23
|
* New pgindent run with fixes suggested by Tom. Patch manually reviewed,Bruce Momjian2001-11-05
| | | | initdb/regression tests pass.
* pgindent run on all C files. Java run to follow. initdb/regressionBruce Momjian2001-10-25
| | | | tests pass.