From 3d490704cabe33bee6b6c757f752846cdbba31fe Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Thu, 23 Apr 2020 01:05:00 +0100 Subject: [PATCH] e system - check chdir return chdir to / will never fail... it's the root dir.. but let's make coverity happy. fix CID 1425454 --- src/bin/system/e_system_main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/bin/system/e_system_main.c b/src/bin/system/e_system_main.c index 0243c2602..7c61d364d 100644 --- a/src/bin/system/e_system_main.c +++ b/src/bin/system/e_system_main.c @@ -201,7 +201,11 @@ setuid_setup(void) } // change CWD to / to avoid path search dlopens finding libs in ./ - chdir("/"); + if (chdir("/") != 0) + { + ERR("Unable to change working dir to /\n"); + exit(1); + } // die with parent - special as this is setuid #ifdef HAVE_PRCTL