summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/util.h
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2007-11-05 01:02:25 +0100
committerDan McGee <dan@archlinux.org>2007-11-05 01:02:25 +0100
commitb55abdce7aebb142ce79da3aa3645afe7693a3c4 (patch)
treea19e1595cb92d4a3571a88acd76ad564fea0aead /lib/libalpm/util.h
parent99f42d6bd2116b0bd8f75394fe92255ca1f4c80b (diff)
downloadpacman-b55abdce7aebb142ce79da3aa3645afe7693a3c4.tar.gz
pacman-b55abdce7aebb142ce79da3aa3645afe7693a3c4.tar.xz
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 <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/util.h')
-rw-r--r--lib/libalpm/util.h2
1 files changed, 2 insertions, 0 deletions
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 <stdio.h>
#include <stdarg.h>
#include <time.h>
+#include <sys/stat.h> /* struct stat */
#ifdef ENABLE_NLS
#include <libintl.h> /* 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 *);