Alvaro Herrera <alvhe...@2ndquadrant.com> writes:
> The implementation I chose for the actual check was to separate the
> permission checks from checkDataDir() into src/port/pgcheckdir.c that
> returns different error codes for each case; see first attachment.
> This part seems pretty reasonable, except that the code should be in
> src/common rather than src/port, but I believe the entire pgcheckdir.c
> file should be moved.

s/CKDIR_TOOACCESIBLE/CKDIR_TOOACCESSIBLE/, and maybe use underscores
to separate the words in those names?  Otherwise no objection.  But
there's not much point in this unless we can figure out where to call
it from for the stat_directory case.

One possibility is to do the initial check somewhere shortly after
ChangeToDataDir(), and have the GUC check hook only attempt to make a
check in SIGHUP context.  Unfortunately we aren't passing the context to
check hooks, only GucSource which isn't adequate for this.  Not sure if we
want to go so far as to change the check-hook API at this point.  We could
probably think of some other, klugy way to tell if it's initial startup.

                        regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to