Commit Graph

1789 Commits

Author SHA1 Message Date
65ada7c810 Translation updates 2007-01-31 08:12:56 +00:00
e53a43bf17 Fix psql's \copy command to ensure that it cycles libpq back to the idle state
(in particular, causing the ReadyForQuery message to be eaten) before
returning from do_copy.  The only known consequence of failing to do so is
that get_prompt might show a wrong result for the %x transaction status
escape, as reported by Bernd Helmle; but it's possible there are other issues.

Back-patch as far as 7.4, the oldest version supporting %x.
2006-11-24 23:07:07 +00:00
8637cd1ee8 Fix 1-byte buffer overrun when OID exceeds 1 billion. This probably can't
cause any serious harm in normal cases, but if you have gcc buffer overrun
checking turned on, that will notice.  Found by Jack Orenstein.  Problem
was already fixed in CVS HEAD.
2006-11-22 21:13:11 +00:00
7b165e3ba5 Fix psql \d commands to behave properly when a pattern using regex | is given.
Formerly they'd emit '^foo|bar$' which is wrong because the anchors are
parsed as part of the alternatives; must emit '^(foo|bar)$' to get expected
behavior.  Same as bug found previously in similar_escape().  Already fixed
in HEAD, this is just back-porting the part of that patch that was a bug fix.
2006-10-10 16:15:37 +00:00
d85820cfb2 Fix ancient oversight in psql's \d pattern processing code: when seeing two
quote chars inside quote marks, should emit one quote *and stay in inquotes
mode*.  No doubt the lack of reports of this have something to do with the
poor documentation of the feature ...
2006-10-07 22:21:57 +00:00
2e319b0e40 Add a new GUC parameter backslash_quote, which determines whether the SQL
parser will allow "\'" to be used to represent a literal quote mark.  The
"\'" representation has been deprecated for some time in favor of the
SQL-standard representation "''" (two single quote marks), but it has been
used often enough that just disallowing it immediately won't do.  Hence
backslash_quote allows the settings "on", "off", and "safe_encoding",
the last meaning to allow "\'" only if client_encoding is a valid server
encoding.  That is now the default, and the reason is that in encodings
such as SJIS that allow 0x5c (ASCII backslash) to be the last byte of a
multibyte character, accepting "\'" allows SQL-injection attacks as per
CVE-2006-2314 (further details will be published after release).  The
"on" setting is available for backward compatibility, but it must not be
used with clients that are exposed to untrusted input.

Thanks to Akio Ishida and Yasuo Ohgaki for identifying this security issue.
2006-05-21 20:11:58 +00:00
48498602a0 Change \' to '', for SQL standards compliance. Backpatch to 7.3, 7.4,
and 8.0.  Later releases already patched.
2006-05-21 19:57:07 +00:00
1fc010cc96 Fix pg_dump to add the required OPERATOR() decoration to schema-qualified
operator names.  This is needed when dumping operator definitions that have
COMMUTATOR (or similar) links to operators in other schemas.
Apparently Daniel Whitter is the first person ever to try this :-(
2006-01-09 21:16:46 +00:00
bf8128f757 Remove DOS line endings ("\r\n") from several .po files. DOS line endings
are inconsistent with the rest of the .po files, and apparently cause
problems for Sun's cc. Per report on IRC from "bitvector2".
2006-01-01 10:14:27 +00:00
6acbe665f7 Translation updates 2005-12-09 22:12:26 +00:00
c9e69d71bd Back-patch fix to correctly quote schema names in --no-owner mode.
Per gripe from Dick Kniep.
2005-08-25 00:11:36 +00:00
0592a1ebc1 Correct some code in pg_restore when reading the header of a tar archive:
(1) The code doesn't initialize `sum', so the initial "does the checksum
    match?" test is wrong.

(2) The loop that is intended to check for a "null block" just checks
    the first byte of the tar block 512 times, rather than each of the
    512 bytes one time (!), which I'm guessing was the intent.

It was only through sheer luck that this worked in the first place.

Per Coverity static analysis performed by EnterpriseDB.
2005-06-22 02:12:19 +00:00
2b6dd51a5f Translation updates 2005-06-17 11:30:57 +00:00
d1d5c0fe2e Translation updates 2005-05-25 08:32:14 +00:00
88c59aeed8 Guard against duplicate IDs in input file in SortTocFromFile().
Per report from Brian Hackett.
2005-05-17 17:30:53 +00:00
a935e36ae9 GCC 4.0 includes a new warning option, -Wformat-literal, that emits
a warning when a variable is used as a format string for printf()
and similar functions (if the variable is derived from untrusted
data, it could include unexpected formatting sequences). This
emits too many warnings to be enabled by default, but it does
flag a few dubious constructs in the Postgres tree. This patch
fixes up the obvious variants: functions that are passed a variable
format string but no additional arguments.

Most of these are harmless (e.g. the ruleutils stuff), but there
is at least one actual bug here: if you create a trigger named
"%sfoo", pg_dump will read uninitialized memory and fail to dump
the trigger correctly.
2005-04-30 08:36:18 +00:00
15ea6d5a2f This patch fixes a bug in the error message emitted by pg_restore on an
incorrect -F argument: write_msg() expects its first parameter to be a
"module name", not the format string.
2005-04-30 08:00:55 +00:00
5328b5ef6b New translations 2004-10-30 08:22:17 +00:00
5b7e88dbe0 Prevent pg_ctl from being run as root. Since it uses configuration files
owned by postgres, doing "pg_ctl start" as root could allow a privilege
escalation attack, as pointed out by iDEFENSE.  Of course the postmaster would
fail, but we ought to fail a little sooner to protect sysadmins unfamiliar
with Postgres.  The chosen fix is to disable root use of pg_ctl in all cases,
just to be confident there are no other holes.
2004-10-22 00:24:27 +00:00
4d608ac197 Prevent pg_ctl restart from adding -D datadir multiple times. 2004-08-28 21:10:00 +00:00
d9dda2d737 Back-patch fix for \r\n line endings in psql's COPY support.
Andrew Dunstan.
2004-08-14 22:24:49 +00:00
ab50cb14a4 Fix incorrect tracking of session authorization in the presence of ACLs
that contain rights granted by non-owners.  Per bug report from
Nishad Prakash.
2004-07-19 21:02:42 +00:00
b43b461396 Translation updates 2004-06-10 22:43:28 +00:00
bf61bdc124 Translation updates 2004-06-10 17:23:12 +00:00
c924c065cd [ Backpatch to 7.4.X.]
Fix problem with doing 7.0.X dumps on character varying[] fields.

Christopher Kings-Lynne
2004-05-26 18:27:23 +00:00
31cf0d6bac Unset PGCLIENTENCODING to prevent backend from dying if it's set
to something incompatible with the -E option.
2004-05-05 16:09:56 +00:00
0feed44305 I thought we'd made initdb safe against newline-munging issues, but on
inspection we fixed only one of the two uses of COPY :-(.  Fix the other.
This is already correct in CVS tip, but 7.4.3 could use the patch.
2004-04-29 19:56:35 +00:00
2510c867d6 Translation updates 2004-04-15 08:13:00 +00:00
96f362bbd6 Translation updates 2004-04-05 08:57:21 +00:00
f0d32c033a Always schema-qualify the name of a function referenced in CREATE CAST.
The former coding failed if the cast function was not in the pg_catalog
schema.  How'd this escape detection?
2004-03-02 21:14:59 +00:00
fee9629cf1 Add missing sprompt.obj psql usage for Borland compiler, per private
report from krizsan.

Backpatch to 7.4.X.
2004-03-02 15:17:32 +00:00
02760606d1 Translation updates 2004-02-28 11:16:58 +00:00
d159c4ba4c Cause pg_dump to emit a 'SET client_encoding' command at the start of
any restore operation, thereby ensuring that dumped data is interpreted
the same way it was dumped even if the target database has a different
encoding.  Per suggestions from Pavel Stehule and others.  Also,
simplify scheme for handling check_function_bodies ... we may as well
just set that at the head of the script.
2004-02-24 03:35:45 +00:00
f8cdde14da Translation updates 2004-02-12 19:17:41 +00:00
052cd647c7 Translation update 2004-01-22 21:13:45 +00:00
6369ace248 Fix incorrect dumping of database LOCATION from 7.0.* servers.
Per report from Mattias Kregert.
2004-01-22 19:09:48 +00:00
5a2a8b9e01 Ensure fflush(stdout) happens in all cases, per gripe from Jon Sablatnig. 2004-01-21 22:05:53 +00:00
51299baa9b Translation update 2004-01-18 14:54:18 +00:00
9575c7af6c Translation updates 2004-01-14 12:14:18 +00:00
91d4f280dd pg_settings should have UPDATE privilege allowed to public.
(Can't force initdb for this in 7.4 branch, but we can at least see to it
that post-7.4.2 installations will get it right.)
2004-01-14 03:47:12 +00:00
d45a3bd772 Translation updates 2004-01-11 19:30:42 +00:00
f94ae60a1f Mark string for translation. 2004-01-11 19:25:44 +00:00
05fb316fbb Fix incorrect SQL syntax emitted when -E is given without -P.
Report and fix from Martin Pitt.
2004-01-09 00:15:19 +00:00
611d33a90a Translation updates 2004-01-08 08:51:31 +00:00
6a78eecf6f Translation updates 2004-01-07 17:44:07 +00:00
0658e7905d Translation updates 2004-01-05 19:15:55 +00:00
1af7b00169 Fix ReadOffset() to work correctly when off_t is wider than int. 2004-01-04 04:02:22 +00:00
8265a1d816 Do an explicit fflush after writing a progress message with puts.
This ensures stdout is kept in sync with messages on stderr.
Per report from Olaf Ferger.
2004-01-01 19:27:28 +00:00
5570c9ee14 Forbid REVOKE on untrusted languages, and don't dump privileges of
untrusted languages (in case they sneak in).
2003-12-19 14:21:43 +00:00
ed651a54fd Add missing $(X). 2003-12-19 11:54:23 +00:00