diff options
Diffstat (limited to 'pseudo_util.c')
-rw-r--r-- | pseudo_util.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pseudo_util.c b/pseudo_util.c index 865222a..7142670 100644 --- a/pseudo_util.c +++ b/pseudo_util.c @@ -82,6 +82,10 @@ static struct pseudo_variables pseudo_env[] = { */ static int pseudo_util_initted = -1; /* Not yet run */ +/* bypass wrapper logic on path computations */ +int (*pseudo_real_lstat)(const char *path, struct stat *buf) = lstat; +int (*pseudo_real_fstat)(int, struct stat *buf) = fstat; + #if 0 static void dump_env(char **envp) { @@ -512,7 +516,7 @@ pseudo_append_element(char *newpath, char *root, size_t allocated, char **pcurre /* if lstat fails, that's fine -- nonexistent files aren't symlinks */ if (!leave_this) { int is_link; - is_link = (lstat(newpath, &buf) != -1) && S_ISLNK(buf.st_mode); + is_link = (pseudo_real_lstat(newpath, &buf) != -1) && S_ISLNK(buf.st_mode); if (link_recursion >= PSEUDO_MAX_LINK_RECURSION && is_link) { pseudo_diag("link recursion too deep, not expanding path '%s'.\n", newpath); is_link = 0; |