check_file_exists: replace lstat with llstat

Paths are constructed directly from package file lists and may contain
trailing slashes, causing lstat to dereference symlinks.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
This commit is contained in:
Andrew Gregory 2014-06-26 12:12:00 -04:00 committed by Allan McRae
parent bbeced26f6
commit c3835c157a
1 changed files with 3 additions and 3 deletions

View File

@ -26,11 +26,11 @@
#include "conf.h"
#include "util.h"
static int check_file_exists(const char *pkgname, const char * filepath,
struct stat * st)
static int check_file_exists(const char *pkgname, char *filepath,
struct stat *st)
{
/* use lstat to prevent errors from symlinks */
if(lstat(filepath, st) != 0) {
if(llstat(filepath, st) != 0) {
if(config->quiet) {
printf("%s %s\n", pkgname, filepath);
} else {