Repository navigation
Conversation
The patch forced interactively started su to allocate its own pseudo-terminal by default. That is not upstream behavior: upstream util-linux only creates a private pty when -P/--pty is given explicitly, and runuser keeps its historical behavior. Remove the patch and its series entry so su returns to the upstream default. -P/--pty is still available for callers that want the private pseudo-terminal, and kernels >= 6.2 keep TIOCSTI disabled by default. No other patches depend on this one; the remaining series still applies cleanly. This re-applies the removal from 3b29e0b, which was reverted in 0591854. Log: Removed the internal UT-2026-0115 su patch, restoring upstream su terminal behavior Influence: 1. Verify su works interactively without a private pty by default 2. Verify su -P/--pty still creates a private pseudo-terminal 3. Verify runuser behavior is unchanged 4. Verify the package builds with the reduced patch series fix: 移除内部 UT-2026-0115 su 伪终端补丁 该补丁让交互式启动的 su 默认分配自己的伪终端。这不是上游行为: 上游 util-linux 只在显式指定 -P/--pty 时才创建私有 pty, runuser 保持原有行为。 移除该补丁及 series 条目,使 su 回到上游默认行为。 需要私有伪终端的调用方仍可使用 -P/--pty, 且 6.2 及以上内核默认禁用 TIOCSTI。 没有其他补丁依赖此补丁,剩余 series 仍可干净应用。 重新应用 3b29e0b 的移除(该提交已被 0591854 回退)。 Log: 移除内部 UT-2026-0115 su 补丁,恢复上游 su 终端行为 Influence: 1. 验证 su 交互式登录默认不再使用私有 pty 2. 验证 su -P/--pty 仍能创建私有伪终端 3. 验证 runuser 行为未发生变化 4. 验证裁剪补丁后的包可以正常构建 repo: util-linux #master
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR removes the internal TIOCSTI-mitigation patch and its quilt-series entry so File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
TAG Bot TAG: 2.40.4-3deepin18 |
|
/integrate |
|
AutoIntegrationPr Bot |
|
/lgtm |
目的
移除内部补丁
UT-2026-0115-su-tiocsti.patch,让su回到上游 util-linux 的默认行为:只有显式指定-P/--pty时才分配私有伪终端。背景
该补丁让「stdin 是 tty 的交互式 su」默认设置
su->force_pty = 1,即无论是否请求,都为目标会话创建一个新的伪终端。这不是上游行为,也不是上游的安全策略:-P/--pty时创建私有 pty,runuser保持历史行为不变;dev.tty.legacy_tiocsti=0),su与调用方不再共享控制终端,依赖同一终端的场景(script/screen/expect、终端复用、部分终端工具与审计方案)会被打断。历史上该移除提交过(
3b29e0b),随后被0591854整体回退;本 PR 重新应用该移除,并带一条新的 changelog 版本条目2.40.4-3deepin18。改动
debian/patches/UT-2026-0115-su-tiocsti.patchdebian/patches/series移除对应条目(其余 46 个补丁顺序不变)debian/changelog新增2.40.4-3deepin18验证
git archive HEAD导出后quilt push -a:46 个补丁全部干净应用,无.rej、无 fuzz;login-utils/su-common.c与未打补丁的上游源码一致(force_pty仅剩上游自身的-P/-T处理),仓库内除 changelog 外不再有UT-2026-0115引用;编译:
--disable-all-programs --enable-su --enable-runuser,su与runuser均编译通过;行为(在 pty 中实测,root 调用
su - <user>):su - <user> -c 'tty'(默认)/dev/pts/10(= 父终端)su -P - <user> -c 'tty'/dev/pts/11(新 pty)-P/--pty仍可用 ✔runuser -u <user> -- echo对照组:本机已安装的 util-linux(带该补丁)默认
su的子进程 tty 是/dev/pts/11,与本分支行为相反,说明移除确实生效。影响
su恢复与调用方共享控制终端;su -P;runuser不受影响。Summary by Sourcery
Restore shared-terminal behavior for interactive
suby dropping the internal automatic pseudo-terminal patch.Bug Fixes:
subehavior by removing the internal patch that automatically allocated a private pseudo-terminal for interactive sessions.su -P/--ptypseudo-terminal allocation while leavingrunuserbehavior unchanged.Chores: