Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/libs/transport/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ aux_source_directory(src TRANSPORT_SRC)

IF(TD_ENTERPRISE)
LIST(APPEND TRANSPORT_SRC ${TD_ENTERPRISE_DIR}/src/plugins/trans/src/transTLSImpl.c)
#LIST(APPEND TRANSPORT_SRC ${TD_ENTERPRISE_DIR}/src/plugins/trans/src/transSaslImpl.c)
LIST(APPEND TRANSPORT_SRC ${TD_ENTERPRISE_DIR}/src/plugins/trans/src/transSaslImpl.c)
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

transSaslImpl.c is now always added when TD_ENTERPRISE is enabled, but libsasl2 is only pulled in on Linux later in this CMake file. If enterprise builds are supported on non-Linux platforms (the top-level options.cmake suggests enterprise Windows builds exist), this unconditional source inclusion can break compilation/linking. Consider appending transSaslImpl.c only when TD_ENTERPRISE && TD_LINUX (or otherwise ensure transSaslImpl.c is fully guarded for non-Linux builds).

Suggested change
LIST(APPEND TRANSPORT_SRC ${TD_ENTERPRISE_DIR}/src/plugins/trans/src/transSaslImpl.c)
IF(TD_LINUX)
LIST(APPEND TRANSPORT_SRC ${TD_ENTERPRISE_DIR}/src/plugins/trans/src/transSaslImpl.c)
ENDIF()

Copilot uses AI. Check for mistakes.
ENDIF()

add_library(transport STATIC ${TRANSPORT_SRC})
Expand Down
5 changes: 4 additions & 1 deletion source/libs/transport/src/transSasl.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ void saslBufferClear(SSaslBuffer* buf) {
saslBufferClearImpl(buf);
}

#if !defined(TD_ENTERPRISE)
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The stub implementations are now compiled only when TD_ENTERPRISE is not defined. However, the transport SASL header and build logic indicate SASL is only available on enterprise Linux (e.g., header includes <sasl/sasl.h> only for TD_ENTERPRISE && LINUX, and libsasl2 is only linked on Linux). For enterprise builds on non-Linux (e.g., Windows), this guard would remove the stubs and likely leave these symbols undefined. Consider changing the guard to compile stubs whenever !(defined(TD_ENTERPRISE) && defined(LINUX)) so non-Linux enterprise builds still have a working fallback.

Suggested change
#if !defined(TD_ENTERPRISE)
#if !(defined(TD_ENTERPRISE) && defined(LINUX))

Copilot uses AI. Check for mistakes.

void saslLibInitImpl() {
return;
}
Expand Down Expand Up @@ -132,6 +134,7 @@ int32_t saslConnHandleAuthImpl(SSaslConn * pConn, const char* input, int32_t len
}

int8_t saslConnShoudDoAuthImpl(SSaslConn * pConn) {
if (pConn == NULL) return 1;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The NULL pointer check for pConn is added within the stub implementation of saslConnShoudDoAuthImpl, which is wrapped in a #if !defined(TD_ENTERPRISE) block. However, the changes in CMakeLists.txt indicate that this build is intended to support Enterprise features where TD_ENTERPRISE is defined. In Enterprise builds, this stub is skipped, and the check will not be present. To effectively prevent potential crashes (e.g., in transSvr.c at line 1752), this NULL check should be moved to the wrapper function saslAuthIsInited at line 74, which is used by both Enterprise and non-Enterprise configurations.

return 0;
Comment on lines 136 to 138
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new NULL handling was added inside the non-enterprise stub implementation. When TD_ENTERPRISE is defined, saslAuthIsInited(NULL) will still dispatch to the enterprise saslConnShoudDoAuthImpl implementation via the wrapper without any NULL guard. Since several call sites pass conn->saslConn without checking for NULL, the NULL check should be enforced in a common location (e.g., in saslAuthIsInited) or guaranteed in the enterprise impl as well; otherwise the reported null-pointer issue may persist for enterprise builds.

Copilot uses AI. Check for mistakes.
}

Expand All @@ -149,4 +152,4 @@ void saslBufferClearImpl(SSaslBuffer* buf) {
return;
}

//#endif
#endif
1 change: 0 additions & 1 deletion source/libs/transport/src/transSvr.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,6 @@ int32_t uvWhiteListAdd(SIpWhiteListTab* pWhite, char* user, SIpWhiteListDual* pl
}

pUserList->ver = ver;

pUserList->pList = plist;

code = taosHashPut(pWhiteList, user, strlen(user), &pUserList, sizeof(void*));
Expand Down
3 changes: 3 additions & 0 deletions test/ci/cases.task
Original file line number Diff line number Diff line change
Expand Up @@ -1048,6 +1048,9 @@
,,y,.,./ci/pytest.sh pytest cases/70-Cluster/test_5dnode_3mnode_stop.py -N 5 -M 3
,,y,.,./ci/pytest.sh pytest cases/70-Cluster/test_5dnode_3mnode_stop.py -N 5 -M 3 -I False

# 73-TLS
,,y,.,./ci/pytest.sh pytest cases/73-TLS/test_tls.py


# 80-Components

Expand Down
Loading