Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

Commit

Permalink
library: Do not follow symlinks
Browse files Browse the repository at this point in the history
Signed-off-by: Ikey Doherty <[email protected]>
  • Loading branch information
Ikey Doherty committed Jun 22, 2015
1 parent 0b918ac commit 9e6b415
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/library/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,14 @@ bool find_sources(const char *path, package_match_func match, bool recurse)
return false;
}

if (stat(path, &st) != 0) {
if (lstat(path, &st) != 0) {
goto end;
}

if (S_ISDIR(st.st_mode)) {
if (S_ISLNK(st.st_mode)) {
ret = false;
goto end;
} else if (S_ISDIR(st.st_mode)) {
if (!(dir = opendir(path))) {
goto end;
}
Expand Down

0 comments on commit 9e6b415

Please sign in to comment.