e system - check chdir return

chdir to / will never fail... it's the root dir.. but let's make
coverity happy.

fix CID 1425454
This commit is contained in:
Carsten Haitzler 2020-04-23 01:05:00 +01:00
parent 273ec41687
commit 3d490704ca
1 changed files with 5 additions and 1 deletions

View File

@ -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