You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2025/10/28 06:25:19 UTC
(camel) branch main updated: CAMEL-22611 Set the minimally required permissions for the renameFile and deleteFile operations (#19718)
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 18d997dfc0b8 CAMEL-22611 Set the minimally required permissions for the renameFile and deleteFile operations (#19718)
18d997dfc0b8 is described below
commit 18d997dfc0b8a6782c5513801d3e17c8babb8830
Author: Valeriy <Ak...@users.noreply.github.com>
AuthorDate: Tue Oct 28 09:25:12 2025 +0300
CAMEL-22611 Set the minimally required permissions for the renameFile and deleteFile operations (#19718)
Co-authored-by: Валерий Акинцев <ak...@gazprom-neft.ru>
---
.../src/main/java/org/apache/camel/component/smb/SmbOperations.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/components/camel-smb/src/main/java/org/apache/camel/component/smb/SmbOperations.java b/components/camel-smb/src/main/java/org/apache/camel/component/smb/SmbOperations.java
index 2a029e29bf34..ba038a897233 100644
--- a/components/camel-smb/src/main/java/org/apache/camel/component/smb/SmbOperations.java
+++ b/components/camel-smb/src/main/java/org/apache/camel/component/smb/SmbOperations.java
@@ -176,7 +176,7 @@ public class SmbOperations implements SmbFileOperations {
public boolean deleteFile(String name) throws GenericFileOperationFailedException {
connectIfNecessary();
if (share.fileExists(name)) {
- try (File f = share.openFile(name, EnumSet.of(AccessMask.GENERIC_ALL), null,
+ try (File f = share.openFile(name, EnumSet.of(AccessMask.DELETE), null,
SMB2ShareAccess.ALL,
SMB2CreateDisposition.FILE_OPEN, null)) {
f.deleteOnClose();
@@ -194,7 +194,7 @@ public class SmbOperations implements SmbFileOperations {
public boolean renameFile(String from, String to) throws GenericFileOperationFailedException {
connectIfNecessary();
try (File src
- = share.openFile(from, EnumSet.of(AccessMask.GENERIC_ALL), null,
+ = share.openFile(from, EnumSet.of(AccessMask.GENERIC_READ, AccessMask.DELETE), null,
SMB2ShareAccess.ALL, SMB2CreateDisposition.FILE_OPEN, null)) {
try (File dst