|From:||tgl(at)postgresql(dot)org (Tom Lane)|
|Subject:||pgsql: Fix a number of places that were making file-type tests|
|Views:||Raw Message | Whole Thread | Download mbox | Resend email|
Fix a number of places that were making file-type tests infelicitously.
The places that did, eg,
(statbuf.st_mode & S_IFMT) == S_IFDIR
were correct, but there is no good reason not to use S_ISDIR() instead,
especially when that's what the other 90% of our code does. The places
that did, eg,
(statbuf.st_mode & S_IFDIR)
were flat out *wrong* and would fail in various platform-specific ways,
eg a symlink could be mistaken for a regular file on most Unixen.
The actual impact of this is probably small, since the problem cases
seem to always involve symlinks or sockets, which are unlikely to be
found in the directories that PG code might be scanning. But it's
clearly trouble waiting to happen, so patch all the way back anyway.
(There seem to be no occurrences of the mistake in 7.4.)
dbsize.c (r1.16 -> r184.108.40.206)
genfile.c (r1.17 -> r220.127.116.11)
copydir.c (r1.21 -> r18.104.22.168)
exec.c (r22.214.171.124 -> r126.96.36.199)
pg_regress.c (r188.8.131.52 -> r184.108.40.206)
|Next Message||Tom Lane||2008-03-31 01:32:17||pgsql: Fix a number of places that were making file-type tests|
|Previous Message||Tom Lane||2008-03-31 01:31:43||pgsql: Fix a number of places that were making file-type tests|