Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

terminal line settings are not reset if SIGINT is received while waiting for pam plugin

Đang mở
#402 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
c, linux
Lĩnh vực
cli, operating-systems

Hướng nghiên cứu

Start by tracing how sudo handles SIGINT while waiting for PAM authentication and where terminal line settings are saved and restored; the payload does not name source files or tests. Reproduce with an interactive PAM module and compare stty -a before and after pressing Ctrl-C. Done means the original terminal settings are restored and the interrupted authentication returns cleanly.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

When sudo is configured to use a pam module like pam_agent_auth trying to abort with CTRL-C(/SIGINT) sudo before the pam module returns, will break terminals. As line settings are not reset back to their original state potentially requiring the terminal to be restarted to use it again or settings to be reset in extra command if still possible.

The time window for that is generally short, but if the pam module requires interactive authentication, like physical touch for presence detection, it becomes much more likely for this to be triggered.

Further sudo wont early anyway, waiting for the authentication to timeout or succeed before finally failing.

Environment

Operating System: Nixos 24.11
Sudo version: 1.1.15p5
terminal and shell: kitty+zsh, also reproduced using different shells and terminals.

Reproduce
  • use ssh-key that requires interactive authentication (password protected/yubikey/etc)
  • Add pam module like pam_agent_auth to /etc/pam.d/sudo
    auth sufficient pam_ssh_agent_auth.so file=/etc/ssh/authorized_keys.d/%u
  • add ssh key to for user to directory
  • ensure user is in sudoers file
  • open new shell and check terminal line settings with stty -a
  • execute command with sudo in that shell
  • press CTRL-C
  • wait for sudo to return
  • execute 'tty -a again and compare to before. some settings will be changed and terminal might be broken
Ngôn ngữ chính
C
Star
1.7k
Fork
306
Merge trung bình
1 ngày 2 giờ
Pull request đã merge (30 ngày)
22

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của sudo-project/sudo

Tất cả issue của sudo-project/sudo

Issue tương tự

Thêm issue về C

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.