summaryrefslogtreecommitdiff
path: root/src/port/dirmod.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2006-07-18 22:36:46 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2006-07-18 22:36:46 +0000
commit88295244be6a86aaa09a822ee857484cb46fd3ca (patch)
tree92b1b5fcbc92a26c9e9359c38539edf46744819d /src/port/dirmod.c
parent11b7aecbd4895897fcb6eb5b4d8a6dfb4df85305 (diff)
copydir() and rmtree() need to use lstat, not stat, to behave as expected
with symlinks. Noted while trying to use rmtree in new C-code pg_regress.
Diffstat (limited to 'src/port/dirmod.c')
-rw-r--r--src/port/dirmod.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/port/dirmod.c b/src/port/dirmod.c
index d806a9ba8d7..e58384a749c 100644
--- a/src/port/dirmod.c
+++ b/src/port/dirmod.c
@@ -10,7 +10,7 @@
* Win32 (NT, Win2k, XP). replace() doesn't work on Win95/98/Me.
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/port/dirmod.c,v 1.42 2006/03/05 15:59:10 momjian Exp $
+ * $PostgreSQL: pgsql/src/port/dirmod.c,v 1.43 2006/07/18 22:36:46 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -434,7 +434,7 @@ rmtree(char *path, bool rmtopdir)
{
snprintf(filepath, MAXPGPATH, "%s/%s", path, *filename);
- if (stat(filepath, &statbuf) != 0)
+ if (lstat(filepath, &statbuf) != 0)
goto report_and_fail;
if (S_ISDIR(statbuf.st_mode))