зеркало из https://github.com/Azure/sonic-openssh.git
explicitly test set[ug]id() return values
Legacy !_POSIX_SAVED_IDS path only; coverity report via Ed Maste ok dtucker@
This commit is contained in:
Родитель
91a2135f32
Коммит
c17e4638e5
|
@ -162,8 +162,10 @@ restore_uid(void)
|
|||
* Propagate the real uid (usually more privileged) to effective uid
|
||||
* as well.
|
||||
*/
|
||||
setuid(getuid());
|
||||
setgid(getgid());
|
||||
if (setuid(getuid()) == -1)
|
||||
fatal("%s: setuid failed: %s", __func__, strerror(errno));
|
||||
if (setgid(getgid()) == -1)
|
||||
fatal("%s: setgid failed: %s", __func__, strerror(errno));
|
||||
#endif /* SAVED_IDS_WORK_WITH_SETEUID */
|
||||
|
||||
if (setgroups(saved_egroupslen, saved_egroups) == -1)
|
||||
|
|
Загрузка…
Ссылка в новой задаче