diff options
author | Andreas Gruenbacher <agruen@linbit.com> | 2012-09-19 01:44:11 +0200 |
---|---|---|
committer | Andreas Gruenbacher <agruen@linbit.com> | 2012-09-19 02:51:23 +0200 |
commit | b578985c3cdf160ad58b43715bdfa324cdf15618 (patch) | |
tree | 2cfb335c7306a44a917604bdf4f5e77c1a6b36fe | |
parent | 3b934d69038a9b3729fafd43d6174dc7523a9d97 (diff) | |
download | patch-b578985c3cdf160ad58b43715bdfa324cdf15618.tar.gz |
Use stat where we want to follow symlinks
* src/pch.c (prefix_components): Follow symlinks.
(cwd_is_root): Follow symlinks.
-rw-r--r-- | src/pch.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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; |