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.
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
In response to
pgsql-docs by date
|Next:||From: Marti Raudsepp||Date: 2011-12-06 16:27:22|
|Subject: Re: docs update for count(*) and index-only scans|
|Previous:||From: Magnus Hagander||Date: 2011-12-06 15:39:51|
|Subject: Re: [HACKERS] Moving tablespaces|
pgsql-hackers by date
|Next:||From: Robert Haas||Date: 2011-12-06 16:11:32|
|Subject: Re: xlog location arithmetic|
|Previous:||From: Tom Lane||Date: 2011-12-06 15:53:58|
|Subject: Re: pull_up_simple_subquery |