]> 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]>
Wed, 3 Jun 2026 04:02:35 +0000 (01:02 -0300)
commita9bcec4f1339a2532efb3611f0ae06769d4e1391
treee3ff1e8639d88e7a9524160359d8112482390045
parent827658de514799d202b3d87dc34f86cf02e8b3b2
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