]> git.ipfire.org Git - thirdparty/libcgroup.git/commit
src/api.c fix TOCTOU in cg_mkdir_p()
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Mon, 17 Jul 2023 09:08:19 +0000 (14:38 +0530)
committerTom Hromatka <tom.hromatka@oracle.com>
Wed, 19 Jul 2023 02:58:46 +0000 (20:58 -0600)
commit7d099c46c587deaa1c8657fcdec324cc3b9d5a7e
tree3568cac87c27c9335b845a073c557f81dfc62b02
parentd6d14e8b7ba28966dfd00a6471e9b2667b77705c
src/api.c fix TOCTOU in cg_mkdir_p()

Fix a TOCTOU issue, reported by Coverity tool:

CID 258294 (#1 of 1): Time of check time of use (TOCTOU)42.
fs_check_call: Calling function stat to perform check on real_path

Add new switch for EROFS, to explicitly check if the file exist on
mkdir()'s error path, using a new char pointer.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
src/api.c