mirror of
https://github.com/moparisthebest/pacman
synced 2024-08-13 17:03:46 -04:00
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:
parent
bbeced26f6
commit
c3835c157a
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user