BUG #14063: ALTER SYSTEM accepts 'newline' and renders itself inoperable.

From: julian(dot)schauder(at)credativ(dot)de
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #14063: ALTER SYSTEM accepts 'newline' and renders itself inoperable.
Date: 2016-04-04 19:40:24
Message-ID: 20160404194024.15198.21684@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 14063
Logged by: Julian Schauder
Email address: julian(dot)schauder(at)credativ(dot)de
PostgreSQL version: 9.5.1
Operating system: Linux, Any
Description:

Howdy Hackers,

PostgreSQLs ALTER SYSTEM accepts a newline in its string-statements. This
will cause the postgresql.auto.conf to become unreadable and requires system
intervention (aka removal of the auto.conf)

postgres=# alter system set work_mem to '5MB
';
ALTER SYSTEM
Time: 37,718 ms
postgres=# alter system set work_mem to '5MB';
ERROR: could not parse contents of file "postgresql.auto.conf"
Time: 0,453 ms
postgres=# alter system reset work_mem ;
ERROR: could not parse contents of file "postgresql.auto.conf"
Time: 0,331 ms

According to code analysis i believe the easiest way around this is
tightening the value validation and ignore whitespaces or just remove
newline as a whitespace.

As this appears to be a new bug is relevant in all versions since ALTER
SYSTEM was introduced.

regards,
julian

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2016-04-04 19:56:37 Re: BUG #14062: pg_dump dies after dumping first 60 gigabytes of text for large table
Previous Message dll 2016-04-04 17:32:17 BUG #14062: pg_dump dies after dumping first 60 gigabytes of text for large table