]> git.ipfire.org Git - thirdparty/shadow.git/commit
lib/copydir.c: copy_entry(): Use temporary stat buffer
authorEnrico Scholz <enrico.scholz@sigma-chemnitz.de>
Mon, 18 Mar 2024 11:14:21 +0000 (12:14 +0100)
committerAlejandro Colomar <alx@kernel.org>
Thu, 21 Mar 2024 23:19:06 +0000 (00:19 +0100)
commitaed99b13e0b8bd3141cb98a5fc04eb214eed9b13
tree7a4951661687dd275d26914d56d14c08576f2826
parent89d26e03dbe8d221d2390313801ac0cda722532d
lib/copydir.c: copy_entry(): Use temporary stat buffer

There are no guarantees that fstatat() does not clobber the stat
buffer on errors.

Use a temporary buffer so that the following code sees correct
attributes of the source entry.

Link: <https://github.com/shadow-maint/shadow/issues/973>
Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Reviewed-by: Alejandro Colomar <alx@kernel.org>
Cherry-picked-from: 000619344ddb ("lib/copydir:copy_entry(): use temporary stat buffer")
Link: <https://github.com/shadow-maint/shadow/pull/974>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/copydir.c