Skip to content

[Bug] 权限不足时未安全退出,导致普通用户 crontab 被清空 #1344

Description

@oceanbrooks2025-maker

Verify steps

  • 我已经在 Issue Tracker 中找过我要提出的问题 I have searched on the issue tracker for a related issue.
  • 我已经使用公测版本测试过,问题依旧存在 I have tested using the test mod, and the issue still exists.
  • 我已经仔细看过 常见问题 并无法自行解决问题

Description

当服务由 root 启动、普通用户执行停止时,程序没有检测到权限不足并中止,而是继续执行 cron 清理逻辑。由于普通用户对 /tmp/cron_tmp 无写权限,set_cron.sh 的重定向失败,但后续 cronadd 仍被调用,最终把该普通用户的 crontab 覆盖为空。与此同时,root crontab 中的 ShellCrash 任务因权限不足未被清理。

我理解普通用户不应管理 ShellCrash 服务,但程序在权限不足时不应执行破坏性写操作。建议在进入停止流程前检查当前用户是否为服务启动用户,或在 cronload 失败时立即退出。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions