]> git.corax.cc Git - toolbox/commitdiff
include/ipc: Don't dereference symlinks when subscribing to a topic
authorMatthias Kruk <m@m10k.eu>
Tue, 30 Nov 2021 13:07:29 +0000 (22:07 +0900)
committerMatthias Kruk <m@m10k.eu>
Tue, 30 Nov 2021 13:07:29 +0000 (22:07 +0900)
The `_ipc_endpoint_topic_subscribe()' function dereferences symbolic
links when subscribing to a topic, causing symbolic links to be
created in the wrong directory if the topic already exists.
This commit changes the flags that `_ipc_endpoint_topic_subscribe()'
passes to `ln' so that the target won't be dereferenced if it refers
to a symbolic link.

include/ipc.sh

index bce6f08240a20fe21a094fd124b347293d4b6098..c0b99bc1f792a2471f414c46974cebab97b68c2c 100644 (file)
@@ -654,7 +654,7 @@ _ipc_endpoint_topic_subscribe() {
                return 1
        fi
 
-       if ! ln -sf "$topicdir" "$__ipc_root/$endpoint/subscriptions/$topic"; then
+       if ! ln -sfn "$topicdir" "$__ipc_root/$endpoint/subscriptions/$topic"; then
                rm -f "$topicdir/$__ipc_self"
                return 1
        fi