]> Projects (at) Tadryanom (dot) Me - AdrOS.git/commit
security: Round 5.2 mkstemp/tmpfile/tmpnam secure (U01)
authorTulio A M Mendes <[email protected]>
Mon, 25 May 2026 19:13:02 +0000 (16:13 -0300)
committerTulio A M Mendes <[email protected]>
Mon, 25 May 2026 19:13:02 +0000 (16:13 -0300)
commit6d19a4be12bea74147b072ef47bd1b90cd80b20c
tree6a7019536434dc35f54c24f2f87a597be5fb861f
parent18f72368c75ed2d81f708d2b9c3b5c94d75f6b4e
security: Round 5.2 mkstemp/tmpfile/tmpnam secure (U01)

U01: Secure temporary file creation
- mkstemp: Use /dev/urandom for randomness, fallback to pid+counter
- mkstemp: Use alphanumeric charset (62 chars) instead of only digits
- mkstemp: Always use O_CREAT|O_EXCL with mode 0600
- tmpfile: Use mkstemp for secure creation, unlink immediately for anonymity
- tmpnam: Use mkstemp for secure name generation, don't leave file around

Tests: 119/119 PASS (smoke test, SMP=4)
user/ulibc/src/stdio.c
user/ulibc/src/stdlib.c