| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> | 
|---|---|
| To: | Magnus Hagander <magnus(at)hagander(dot)net> | 
| Cc: | Andrew Dunstan <andrew(at)dunslane(dot)net>, Bruce Momjian <bruce(at)momjian(dot)us>, PostgreSQL-documentation <pgsql-docs(at)postgresql(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> | 
| Subject: | Re: [HACKERS] Moving tablespaces | 
| Date: | 2011-12-06 16:07:56 | 
| Message-ID: | 21564.1323187676@sss.pgh.pa.us | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-docs pgsql-hackers | 
Magnus Hagander <magnus(at)hagander(dot)net> writes:
> There is some nice precedent in the CREATE TABLESPACE command (though
> dependent on HAVE_SYMLINK and not HAVE_READLINK), so I'm just going to
> copy the error message from there.
Fair enough.
Looking at the existing readlink use in port/exec.c, it strikes me that
another thing you'd better do is include a check for buffer overrun,
ie the test needs to be more like
		rllen = readlink(fname, link_buf, sizeof(link_buf));
		if (rllen < 0 || rllen >= sizeof(link_buf))
			... fail ...
Also, you're assuming that the result is already null-terminated,
which is incorrect.
regards, tom lane
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Marti Raudsepp | 2011-12-06 16:27:22 | Re: docs update for count(*) and index-only scans | 
| Previous Message | Magnus Hagander | 2011-12-06 15:39:51 | Re: [HACKERS] Moving tablespaces | 
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Robert Haas | 2011-12-06 16:11:32 | Re: xlog location arithmetic | 
| Previous Message | Tom Lane | 2011-12-06 15:53:58 | Re: pull_up_simple_subquery |