From b578985c3cdf160ad58b43715bdfa324cdf15618 Mon Sep 17 00:00:00 2001 From: Andreas Gruenbacher Date: Wed, 19 Sep 2012 01:44:11 +0200 Subject: Use stat where we want to follow symlinks * src/pch.c (prefix_components): Follow symlinks. (cwd_is_root): Follow symlinks. --- src/pch.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pch.c b/src/pch.c index 8d5f1c4..da6e68f 100644 --- a/src/pch.c +++ b/src/pch.c @@ -403,11 +403,11 @@ cwd_is_root (char const *name) memcpy (root, name, prefix_len); root[prefix_len] = '/'; root[prefix_len + 1] = 0; - if (lstat (root, &st)) + if (stat (root, &st)) return false; root_dev = st.st_dev; root_ino = st.st_ino; - if (lstat (".", &st)) + if (stat (".", &st)) return false; return root_dev == st.st_dev && root_ino == st.st_ino; } @@ -1042,7 +1042,7 @@ prefix_components (char *filename, bool checkdirs) if (checkdirs) { *f = '\0'; - stat_result = lstat (filename, &stat_buf); + stat_result = stat (filename, &stat_buf); *f = '/'; if (! (stat_result == 0 && S_ISDIR (stat_buf.st_mode))) break; -- cgit v1.2.1