From 7eb08a9030a58a69ae9ff7c9af8c017648b84f44 Mon Sep 17 00:00:00 2001 From: Patrick Schmitt Date: Mon, 19 Feb 2024 16:11:50 +0100 Subject: [PATCH] Add permissions to implicitly created symbolic links --- .../gradle/plugins/rpm/RpmFileVisitorStrategy.groovy | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/groovy/com/netflix/gradle/plugins/rpm/RpmFileVisitorStrategy.groovy b/src/main/groovy/com/netflix/gradle/plugins/rpm/RpmFileVisitorStrategy.groovy index e1d5c603..74b1177b 100644 --- a/src/main/groovy/com/netflix/gradle/plugins/rpm/RpmFileVisitorStrategy.groovy +++ b/src/main/groovy/com/netflix/gradle/plugins/rpm/RpmFileVisitorStrategy.groovy @@ -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 } } @@ -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 } } @@ -69,9 +69,9 @@ class RpmFileVisitorStrategy { builder.addDirectory(getRootPath(details), permissions, directive, uname, gname, addParents) } - private void addLinkToBuilder(Tuple2 link) { + private void addLinkToBuilder(Tuple2 link, int permissions) { if (links.add(link)) { - builder.addLink(link.first, link.second) + builder.addLink(link.first, link.second, permissions) } } }