From 8c19e6ca81e108875a899bced37be0e4c06e9e00 Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Sat, 22 Apr 2023 00:32:19 +0000 Subject: [PATCH] GUACAMOLE-926: Ensure that the directory patch replace operation writes to the same directory it reads from. --- .../rest/directory/DirectoryResource.java | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/guacamole/src/main/java/org/apache/guacamole/rest/directory/DirectoryResource.java b/guacamole/src/main/java/org/apache/guacamole/rest/directory/DirectoryResource.java index e696f8f30..7b8342451 100644 --- a/guacamole/src/main/java/org/apache/guacamole/rest/directory/DirectoryResource.java +++ b/guacamole/src/main/java/org/apache/guacamole/rest/directory/DirectoryResource.java @@ -430,6 +430,10 @@ public abstract class DirectoryResource directory) throws GuacamoleException { + // Use the directory associated with this instance if not otherwise + // specified + if (directory == null) + directory = this.directory; + // Retrieve the object having the given identifier InternalType object; try { @@ -639,10 +649,11 @@ public abstract class DirectoryResource resource = resourceFactory.create(authenticatedUser, userContext, directory, object);