Skip to content

Commit

Permalink
Add permissions to implicitly created symbolic links
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuplyx committed Feb 19, 2024
1 parent a9c7e4e commit 7eb08a9
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ class RpmFileVisitorStrategy {
if (parentLink != null) {
def link = relativizeSymlink(details, parentLink)
if (link != null) {
addLinkToBuilder(link)
addLinkToBuilder(link, mode)
return
}
} else if (JavaNIOUtils.isSymbolicLink(details.file)) {
def link = relativizeSymlink(details, file)
if (link != null) {
addLinkToBuilder(link)
addLinkToBuilder(link, mode)
return
}
}
Expand All @@ -47,7 +47,7 @@ class RpmFileVisitorStrategy {
if (JavaNIOUtils.isSymbolicLink(details.file)) {
def link = relativizeSymlink(details, file)
if (link != null) {
addLinkToBuilder(link)
addLinkToBuilder(link, permissions)
return
}
}
Expand All @@ -69,9 +69,9 @@ class RpmFileVisitorStrategy {
builder.addDirectory(getRootPath(details), permissions, directive, uname, gname, addParents)
}

private void addLinkToBuilder(Tuple2<String, String> link) {
private void addLinkToBuilder(Tuple2<String, String> link, int permissions) {
if (links.add(link)) {
builder.addLink(link.first, link.second)
builder.addLink(link.first, link.second, permissions)
}
}
}

0 comments on commit 7eb08a9

Please sign in to comment.