Revert "If there are no hardlinks, dont bother with s-bit and caps removal"
Deciding whether it is necessary to remove the SUID bit based on
the current link count creates an opportunity for a race condition.
A hardlink could be created just between lstat() and chmod().
This reverts commit 89be57ad92
.
This commit is contained in:
parent
7583fcc341
commit
26874707ed
|
@ -1264,7 +1264,7 @@ static int fsmMkdirs(FSM_t fsm)
|
|||
static void removeSBITS(const char *path)
|
||||
{
|
||||
struct stat stb;
|
||||
if (lstat(path, &stb) == 0 && S_ISREG(stb.st_mode) && stb.st_nlink > 1) {
|
||||
if (lstat(path, &stb) == 0 && S_ISREG(stb.st_mode)) {
|
||||
if ((stb.st_mode & 06000) != 0) {
|
||||
(void) chmod(path, stb.st_mode & 0777);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue