Thanks to visit codestin.com
Credit goes to postgrespro.com

Re: [DOCS] Moving tablespaces - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [DOCS] Moving tablespaces
Date
Msg-id [email protected]
Whole thread Raw
In response to Re: [DOCS] Moving tablespaces  (Magnus Hagander <[email protected]>)
Responses Re: [DOCS] Moving tablespaces
List pgsql-hackers
Magnus Hagander <[email protected]> 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

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pull_up_simple_subquery
Next
From: "Azghar Hussain"
Date:
Subject: Recover data....