Skip to content

Commit

Permalink
fix for symlinks with colon (fixes #1374)
Browse files Browse the repository at this point in the history
  • Loading branch information
john30 committed Nov 11, 2024
1 parent bcea04b commit 8d2986c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/ebus/protocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ ProtocolHandler* ProtocolHandler::create(const ebus_protocol_config_t config,
}
}
Transport* transport;
if (strchr(name, '/') == nullptr || strchr(name, ':') != nullptr) {
// symlink device name may contain colon, so only check for absence of slash only
if (strchr(name, '/') == nullptr) {
char* in = strdup(name);
bool udp = false;
char* addrpos = in;
Expand All @@ -97,6 +98,7 @@ ProtocolHandler* ProtocolHandler::create(const ebus_protocol_config_t config,
transport = new NetworkTransport(name, config.extraLatency, hostOrIp, port, udp);
} else {
// support ens:/dev/<device>, enh:/dev/<device>, and /dev/<device>
// as well as symlinks like /dev/serial/by-id/...Espressif_00:01:02:03...
transport = new SerialTransport(name, config.extraLatency, !config.noDeviceCheck, speed);
}
Device* device;
Expand Down

0 comments on commit 8d2986c

Please sign in to comment.