Fix file swapping race condition in pool_passwd.
authorTatsuo Ishii <ishii@sraoss.co.jp>
Mon, 30 Nov 2020 04:01:52 +0000 (13:01 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Mon, 30 Nov 2020 04:15:42 +0000 (13:15 +0900)
commit86d4dd0ec4816764cfe1caa2c964fb6efb0952e6
tree6e6a9fb604ec3f018d8490755cabac7d4f9f5dba
parent96041561d95b9de0c082dc1764f2b8f4b15be1f6
Fix file swapping race condition in pool_passwd.

Existing implementation first stats pool passwd file and then open the
file. To prevent file-swapping due to file race conditions, open the
key file before checking it by stat().

Patch by: Masaya Kawamoto
src/auth/pool_passwd.c