Impl. setting stored UID/GID if EUID 0
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 6s
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 6s
This commit is contained in:
parent
bbfad6da9c
commit
1d60388f5d
1 changed files with 7 additions and 0 deletions
|
@ -2318,6 +2318,13 @@ int simple_archiver_parse_archive_version_1(FILE *in_f, int_fast8_t do_extract,
|
||||||
SIMPLE_ARCHIVER_PLATFORM == SIMPLE_ARCHIVER_PLATFORM_LINUX
|
SIMPLE_ARCHIVER_PLATFORM == SIMPLE_ARCHIVER_PLATFORM_LINUX
|
||||||
if (chmod(file_info->filename, permissions) == -1) {
|
if (chmod(file_info->filename, permissions) == -1) {
|
||||||
return SDAS_INTERNAL_ERROR;
|
return SDAS_INTERNAL_ERROR;
|
||||||
|
} else if (geteuid() == 0 &&
|
||||||
|
chown(file_info->filename, file_info->uid,
|
||||||
|
file_info->gid) != 0) {
|
||||||
|
fprintf(stderr,
|
||||||
|
"ERROR Failed to set UID/GID as EUID 0 of file \"%s\"!\n",
|
||||||
|
file_info->filename);
|
||||||
|
return SDAS_INTERNAL_ERROR;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue