- Feb 23, 2012
-
-
Tom Lane authored
Both libpq and the backend would truncate a common name extracted from a certificate at 32 bytes. Replace that fixed-size buffer with dynamically allocated string so that there is no hard limit. While at it, remove the code for extracting peer_dn, which we weren't using for anything; and don't bother to store peer_cn longer than we need it in libpq. This limit was not so terribly unreasonable when the code was written, because we weren't using the result for anything critical, just logging it. But now that there are options for checking the common name against the server host name (in libpq) or using it as the user's name (in the server), this could result in undesirable failures. In the worst case it even seems possible to spoof a server name or user name, if the correct name is exactly 32 bytes and the attacker can persuade a trusted CA to issue a certificate in which that string is a prefix of the certificate's common name. (To exploit this for a server name, he'd also have to send the connection astray via phony DNS data or some such.) The case that this is a realistic security threat is a bit thin, but nonetheless we'll treat it as one. Back-patch to 8.4. Older releases contain the faulty code, but it's not a security problem because the common name wasn't used for anything interesting. Reported and patched by Heikki Linnakangas Security: CVE-2012-0867
-
- Feb 22, 2012
-
-
Peter Eisentraut authored
This allows changing the location of the files that were previously hard-coded to server.crt, server.key, root.crt, root.crl. server.crt and server.key continue to be the default settings and are thus required to be present by default if SSL is enabled. But the settings for the server-side CA and CRL are now empty by default, and if they are set, the files are required to be present. This replaces the previous behavior of ignoring the functionality if the files were not found.
-
- Jan 02, 2012
-
-
Bruce Momjian authored
-
- Dec 16, 2011
-
-
Robert Haas authored
-
- Sep 09, 2011
-
-
Tom Lane authored
As per my recent proposal, this refactors things so that these typedefs and macros are available in a header that can be included in frontend-ish code. I also changed various headers that were undesirably including utils/timestamp.h to include datatype/timestamp.h instead. Unsurprisingly, this showed that half the system was getting utils/timestamp.h by way of xlog.h. No actual code changes here, just header refactoring.
-
- Sep 01, 2011
-
-
Bruce Momjian authored
Fix pgrminclude C comment marker.
-
Bruce Momjian authored
-
Bruce Momjian authored
-
Bruce Momjian authored
-
- Jun 28, 2011
-
-
Alvaro Herrera authored
The previous coding was ugly, as it marked special tokens as such in the wrong stage, relying on workarounds to figure out if they had been quoted in the original or not. This made it impossible to have specific keywords be recognized as such only in certain positions in HBA lines, for example. Fix by restructuring the parser code so that it remembers whether tokens were quoted or not. This eliminates widespread knowledge of possible known keywords for all fields. Also improve memory management in this area, to use memory contexts that are reset as a whole instead of using retail pfrees; this removes a whole lotta crufty (and probably slow) code. Instead of calling strlen() three times in next_field_expand on the returned token to find out whether there was a comma (and strip it), pass back the info directly from the callee, which is simpler. In passing, update historical artifacts in hba.c API. Authors: Brendan Jurd, Alvaro Herrera Reviewed by Pavel Stehule
-
- Apr 10, 2011
-
-
Bruce Momjian authored
-
- Mar 30, 2011
-
-
Heikki Linnakangas authored
than replication_timeout (a new GUC) milliseconds. The TCP timeout is often too long, you want the master to notice a dead connection much sooner. People complained about that in 9.0 too, but with synchronous replication it's even more important to notice dead connections promptly. Fujii Masao and Heikki Linnakangas
-
- Mar 19, 2011
-
-
Magnus Hagander authored
This removes an overloading of two authentication options where one is very secure (peer) and one is often insecure (ident). Peer is also the name used in libpq from 9.1 to specify the same type of authentication. Also make initdb select peer for local connections when ident is chosen, and ident for TCP connections when peer is chosen. ident keyword in pg_hba.conf is still accepted and maps to peer authentication.
-
- Jan 01, 2011
-
-
Bruce Momjian authored
-
- Oct 27, 2010
-
-
Robert Haas authored
KaiGai Kohei, with minor cleanup of the comments by me.
-
- Oct 18, 2010
-
-
Peter Eisentraut authored
-
- Oct 15, 2010
-
-
Peter Eisentraut authored
Peter Eisentraut, reviewed by KaiGai Kohei and Tom Lane
-
- Sep 20, 2010
-
-
Magnus Hagander authored
-
- Apr 19, 2010
-
-
Simon Riggs authored
rejection retains same message as before.
-
- Feb 26, 2010
-
-
Bruce Momjian authored
-
- Jan 27, 2010
-
-
Magnus Hagander authored
-
- Jan 20, 2010
-
-
Heikki Linnakangas authored
binary, revert PGDLLIMPORT decoration of global variables. I'm not sure if there's any real harm from unnecessary PGDLLIMPORTs, but these are all internal variables that external modules really shouldn't be messing with. ThisTimeLineID still needs PGDLLIMPORT.
-
- Jan 16, 2010
- Jan 15, 2010
-
-
Heikki Linnakangas authored
This includes two new kinds of postmaster processes, walsenders and walreceiver. Walreceiver is responsible for connecting to the primary server and streaming WAL to disk, while walsender runs in the primary server and streams WAL from disk to the client. Documentation still needs work, but the basics are there. We will probably pull the replication section to a new chapter later on, as well as the sections describing file-based replication. But let's do that as a separate patch, so that it's easier to see what has been added/changed. This patch also adds a new section to the chapter about FE/BE protocol, documenting the protocol used by walsender/walreceivxer. Bump catalog version because of two new functions, pg_last_xlog_receive_location() and pg_last_xlog_replay_location(), for monitoring the progress of replication. Fujii Masao, with additional hacking by me
-
- Jan 10, 2010
-
-
Magnus Hagander authored
This silences some warnings on Win64. Not using the proper SOCKET datatype was actually wrong on Win32 as well, but didn't cause any warnings there. Also create define PGINVALID_SOCKET to indicate an invalid/non-existing socket, instead of using a hardcoded -1 value.
-
- Jan 02, 2010
-
-
Bruce Momjian authored
-
- Dec 17, 2009
-
-
Peter Eisentraut authored
This was possibly linked to a deadlock-like situation in glibc syslog code invoked by the ereport call in quickdie(). In any case, a signal handler should not unblock its own signal unless there is a specific reason to.
-
- Dec 16, 2009
-
-
Peter Eisentraut authored
This removes some duplicate code that recreated the identical workaround when the newer signal API is missing.
-
- Dec 12, 2009
-
-
Magnus Hagander authored
does a search for the user in the directory first, and then binds with the DN found for this user. This allows for LDAP logins in scenarios where the DN of the user cannot be determined simply by prefix and suffix, such as the case where different users are located in different containers. The old way of authentication can be significantly faster, so it's kept as an option. Robert Fleming and Magnus Hagander
-
- Dec 11, 2009
-
-
Itagaki Takahiro authored
A new system catalog pg_largeobject_metadata manages ownership and access privileges of large objects. KaiGai Kohei, reviewed by Jaime Casanova.
-
- Oct 01, 2009
-
-
Tom Lane authored
by enumerating the machine's IP interfaces to look for a match. Stef Walter
-
- Sep 01, 2009
-
-
Tom Lane authored
declaration.
-
- Aug 29, 2009
-
-
Tom Lane authored
(That flat file is now completely useless, but removal will come later.) To do this, postpone client authentication into the startup transaction that's run by InitPostgres. We still collect the startup packet and do SSL initialization (if needed) at the same time we did before. The AuthenticationTimeout is applied separately to startup packet collection and the actual authentication cycle. (This is a bit annoying, since it means a couple extra syscalls; but the signal handling requirements inside and outside a transaction are sufficiently different that it seems best to treat the timeouts as completely independent.) A small security disadvantage is that if the given database name is invalid, this will be reported to the client before any authentication happens. We could work around that by connecting to database "postgres" instead, but consensus seems to be that it's not worth introducing such surprising behavior. Processing of all command-line switches and GUC options received from the client is now postponed until after authentication. This means that PostAuthDelay is much less useful than it used to be --- if you need to investigate problems during InitPostgres you'll have to set PreAuthDelay instead. However, allowing an unauthenticated user to set any GUC options whatever seems a bit too risky, so we'll live with that.
-
- Jun 11, 2009
-
-
Bruce Momjian authored
provided by Andrew.
-
- Apr 20, 2009
-
-
Tom Lane authored
-
- Mar 02, 2009
-
-
Tom Lane authored
encoding conversion of any elog/ereport message being sent to the frontend. This generalizes a patch that I put in last October, which suppressed translation of only specific messages known to be associated with recursive can't-translate-the-message behavior. As shown in bug #4680, we need a more general answer in order to have some hope of coping with broken encoding conversion setups. This approach seems a good deal less klugy anyway. Patch in all supported branches.
-
- Jan 07, 2009
-
-
Magnus Hagander authored
to pass the full username@realm string to the authentication instead of just the username. This makes it possible to use pg_ident.conf to authenticate users from multiple realms as different database users.
-
Magnus Hagander authored
authentication options to be set in pg_hba.conf on a per-line basis, to override the defaults set in postgresql.conf.
-
- Jan 01, 2009
-
-
Bruce Momjian authored
-