π‘οΈ Sentinel: [MEDIUM] Fix fd leak and unsafe path bridging on PID lock#248
Conversation
|
π Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a π emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Calling `open(2)` without `O_CLOEXEC` causes the file descriptor to leak to child processes, which could prevent the PID lock from being released on daemon shutdown. Implicit path string bridging may not produce a valid file system representation. This adds `O_CLOEXEC`, uses `S_IRUSR | S_IWUSR` for atomic 0600 mode application, and `withUnsafeFileSystemRepresentation` for safe string passing. Co-authored-by: acebytes <2820910+acebytes@users.noreply.github.com>
343bcf0 to
05935a5
Compare
π¨ Severity: MEDIUM
π‘ Vulnerability: Missing
O_CLOEXECcauses the file descriptor to leak to child processes. Implicit path string bridging may not produce a valid file system representation.π― Impact: Child processes could inherit the PID lock file descriptor, preventing the lock from being released on daemon shutdown.
π§ Fix: Added
O_CLOEXEC, usedS_IRUSR | S_IWUSRfor atomic 0600 mode application, andwithUnsafeFileSystemRepresentationfor safe string passing.β Verification: Verified file modifications and executed test suite successfully.
PR created automatically by Jules for task 16921181005958822429 started by @acebytes