Up to [local] / src / usr.bin / x99token
Request diff between arbitrary revisions
Default branch: MAIN
Current tag: OPENBSD_6_0_BASE
Revision 1.12 / (download) - annotate - [select for diffs], Thu Oct 15 19:30:03 2015 UTC (8 years, 7 months ago) by bluhm
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE,
OPENBSD_6_1,
OPENBSD_6_0_BASE,
OPENBSD_6_0,
OPENBSD_5_9_BASE,
OPENBSD_5_9
Changes since 1.11: +4 -3 lines
Diff to previous 1.11 (colored)
Avoid a race between fopen(3) and fchmod(2). Use umask(2) and unlink(2) and fopen(3) to prevent an attacker to open an old file with wrong permissions before the secret is written into it. This also guarantees that a new file with correct permissions is created. Without fchmod(2) "fattr" can be removed from pledge. with and OK deraadt@