chore: nudge cooldown sentinel opens its file with its own O_NOFOLLOW code instead of internal/nofollow

Đang mở Phù hợp với người mới
#379 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ó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
82/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go
Lĩnh vực
backend

Hướng nghiên cứu

Đọc internal/nudge/cooldown.go và kiểm tra recordFire, sau đó xem API internal/nofollow được thêm trong #378. Thay đổi thao tác mở tệp sentinel để dùng nofollow.OpenFile, đồng thời giữ các kiểm tra Lstat hiện có trên thư mục và sentinel; tìm các bài kiểm thử bao quát symlink bị từ chối và các kiểu lỗi tương ứng trong cổng nudge và các tệp chỉ mục.

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

Mô tả

chore needs-triage
What kind of chore?

Other

What needs doing?

internal/nudge/cooldown.go opens its sentinel file with its own os.OpenFile(path, os.O_WRONLY|os.O_CREATE|syscall.O_NOFOLLOW, 0o600) call in recordFire. #378 added internal/nofollow, which opens a file without following a symbolic link. It also maps ELOOP, and EEXIST on a link, to *nofollow.SymlinkError, which matches nofollow.ErrSymlink.

Change recordFire to use nofollow.OpenFile. Keep the existing Lstat checks on the directory and the sentinel. Then a refused link gives the same error type in the nudge gate as in the index files.

Why now?

Tidiness. The sentinel already refuses a link, so this is not a security fix. It removes a second copy of the open rule that #378 put in one place.

Does this touch anything load-bearing?
  • None of these
Before submitting
  • I searched existing issues and this is not a duplicate

🤖 Generated with Claude Code

Ngôn ngữ chính
Go
Star
0
Fork
0
Merge trung bình
7 giờ 42 phút
Pull request đã merge (30 ngày)
111

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

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 seanb4t/codegraph-go

Tất cả issue của seanb4t/codegraph-go

Issue tương tự

Thêm issue về Go

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.