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
1 changed files with 3 additions and 3 deletions
|
@ -26,11 +26,11 @@
|
||||||
#include "conf.h"
|
#include "conf.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
static int check_file_exists(const char *pkgname, const char * filepath,
|
static int check_file_exists(const char *pkgname, char *filepath,
|
||||||
struct stat * st)
|
struct stat *st)
|
||||||
{
|
{
|
||||||
/* use lstat to prevent errors from symlinks */
|
/* use lstat to prevent errors from symlinks */
|
||||||
if(lstat(filepath, st) != 0) {
|
if(llstat(filepath, st) != 0) {
|
||||||
if(config->quiet) {
|
if(config->quiet) {
|
||||||
printf("%s %s\n", pkgname, filepath);
|
printf("%s %s\n", pkgname, filepath);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Reference in a new issue