From b55abdce7aebb142ce79da3aa3645afe7693a3c4 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sun, 4 Nov 2007 18:02:25 -0600 Subject: libalpm: use an lstat wrapper so we never dereference dir symlinks Linux lstat follows POSIX standards and dereferences a symlink pointing to a directory if there is a trailing slash. For purposes of libalpm, we don't want this so make a lstat wrapper that suppresses this behavior. Signed-off-by: Dan McGee --- lib/libalpm/util.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/libalpm/util.h') diff --git a/lib/libalpm/util.h b/lib/libalpm/util.h index e8b1d719..5d0b3693 100644 --- a/lib/libalpm/util.h +++ b/lib/libalpm/util.h @@ -30,6 +30,7 @@ #include #include #include +#include /* struct stat */ #ifdef ENABLE_NLS #include /* here so it doesn't need to be included elsewhere */ @@ -62,6 +63,7 @@ void _alpm_time2string(time_t t, char *buffer); int _alpm_str_cmp(const void *s1, const void *s2); char *_alpm_filecache_find(const char *filename); const char *_alpm_filecache_setup(void); +int _alpm_lstat(const char *path, struct stat *buf); #ifndef HAVE_STRVERSCMP int strverscmp(const char *, const char *); -- cgit v1.2.3-24-g4f1b