This temporary chmod of the PTY to mode 0666 is most likely a remnant of past times, before the PTY file descriptor was passed to the target session via the UNIX domain socket. This chmod() causes a race condition during which any other user in the system can open the PTY for reading and writing, and thus allows PTY hijacking. CREATE(Triage):(User=myu2) CVE-2025-46802 (https://nvd.nist.gov/vuln/detail/CVE-2025-46802)