Pull Request已成功合入, 合并人@opengauss_bot
(感谢 luodongxu 的贡献)openGauss pipeline is running. Please wait a moment...


Welcome To openGauss Community
Hey @luodongxu , thanks for your contribution to the community.
Bot Usage Manual
I'm the Bot here serving you. You can find the instructions on how to interact with me at Here . That means you can comment below every pull request or issue to trigger Bot Commands. You can self-configure the PR merge rules for this repository. For more details, please refer to Here.
Contact Guide
If you have any questions, please contact the SIG: StorageEngine, AI, CM, CloudNative, SecurityTechnology, SQLEngine ,
and any of the maintainers: @CarrotGo, @chendong76, @chenxiaobin19, @congzhou2603, @dodders, @hwworkholic, @jemappellehc, @libiao2024, @muyulinzhong, @quemingjian, @shenzheng4, @shirley_zhengx, @superlchf, @totaj, @wlff234, @wofanzheng, @ywzq1161327784 ,
and any of the committers: @Igali, @bihua111, @cailei19, @h_ray, @levy53071, @libiao2024, @lihaixiao, @mrzack, @wangfeihuo, @wuyuechuan, @xiong_xjun, @zhangfengzhi123, @zhangxubo, @zhangzq131, @zjh_hw .


Linking PR Notice
@luodongxu , the pull request should be linked to at least one https://gitcode.com/opengauss/docs repository's PR.
If it is confirmed that no PR association is needed, you can remove the label by commenting /remove-need-doc .


/remove-need-doc


✅ 跳过 docs ci 检查,没有需要检查的文档文件


| Check Name | Build Result | Build Details |
|---|---|---|
| openGauss_Lite_Pr | ✅ SUCCESS | #4097 |


/check-pr


Merge Verification Failed
@luodongxu, this pr is not mergeable and the reasons are below:
Not Enough Labels
- the pull request needs 1 approved labels, but now gets 0.
- the pull request needs 1 ci-pipeline-success labels, but now gets 0.
- the pull request needs 2 lgtm labels, but now gets 0.
Label Usage Tips
- approved: Agree to merge the pull request. This can be accomplished by commenting
/approve - lgtm: The code has been reviewed. This can be accomplished by commenting
/lgtm


| Check Name | Build Result | Build Details |
|---|---|---|
| openGauss_server_pr | ✅ Success | #32161 |


/lgtm
/approve


/lgtm


✅ PR 9757 回归验证报告
结论:修复有效、回归用例有效、相邻用例无回归 —— 回归验证通过。
验证对象:security-7.0.0 -> 7.0.0,回合提交 339214dd8(源 PR !9364 / 源提交 7ef9e2ceb)。

1. 回合一致性(git 逐字节比对)
| 文件 | 结果 |
|---|---|
src/common/backend/libpq/hba.cpp |
✅ 与源 commit 7ef9e2ceb 逐字节一致 |
input/replication_standbywrite_security.py |
✅ 逐字节一致 |
input/replication_standbywrite_security.source |
✅ 逐字节一致 |
output/replication_standbywrite_security.source |
✅ 逐字节一致 |
parallel_schedule |
✅ 逐字节一致 |
parallel_schedule0 |
✅ 仅 7.0.0 分支已有用例差异(smp / gpi_merge_upsert / prefix_sort),双方改动均保留 |
2. 全量编译
sh build.sh -m release -3rd <binarylibs> --cmake → BUILD_EXIT=0。
3. 新增回归用例(修复后)
make fastcheck_single PART=9757(schedule: test: replication_standbywrite_security):
test(1/1) replication_standbywrite_security .... okAll 1 tests passed.- 实际输出:
REJECTED_BY_REMOTE_TRUST_POLICY
4. 负向对照(还原 hba.cpp 至修复前 9945f2770 后增量重编)
1 of 1 tests failed.- 实际输出:
TRUST_ACCEPTED(期望REJECTED_BY_REMOTE_TRUST_POLICY) - 说明:修复前来自非内部 IP 的
replication=standbywrite连接确实可绕过远程 trust 禁止策略完成认证,证明漏洞可复现、新增用例非空转。
5. 相邻安全用例回归(修复态同批运行)
test(1/2) remotetype_trust_security .... oktest(2/2) replication_standbywrite_security .... okAll 2 tests passed.
代码层面复核
AM_WAL_SENDER宏已包含 HADR 角色;check_db()增加t_thrd.role == SW_SENDER后,非内部 SW/HADR 连接落入普通check_hba()并匹配 replication token,从而触发远程 trust 禁止策略;- 内部复制连接(
is_node_internal_connection为真)仍走check_hba_replication(),行为不变,gs_basebackup兼容逻辑保留。
环境说明
pg_regress与gaussdb均拒绝 root 运行,测试以普通用户执行;/tmp为 tmpfs 不支持O_DIRECT(initdb double-write 文件创建会EINVAL),测试数据目录临时置于/var/tmp,测试后已恢复;- 磁盘受限,
gaussdb仅执行strip --strip-debug(去调试符号,不影响行为)。


【标题】回合7.0.0:修复 DB-04 HADR/SW 复制发送方绕过内部连接校验的认证绕过问题
【回合说明】
【实现内容】
【根因分析】
【实现方案】
【关联需求或issue】
https://gitcode.com/opengauss/openGauss-server/issues/8245
【开发自验报告】
【其他说明】