Fix naming conflicts in cpp/world-writable-file-creation

This commit is contained in:
Jeroen Ketema
2022-02-02 17:36:14 +01:00
parent f32500306a
commit aa4651312e

View File

@@ -12,17 +12,16 @@
import cpp
import FilePermissions
import semmle.code.cpp.commons.unix.Constants
predicate worldWritableCreation(FileCreationExpr fc, int mode) {
mode = localUmask(fc).mask(fc.getMode()) and
sets(mode, s_iwoth())
sets(mode, UnixConstants::s_iwoth())
}
predicate setWorldWritable(FunctionCall fc, int mode) {
fc.getTarget().getName() = ["chmod", "fchmod", "_chmod", "_wchmod"] and
mode = fc.getArgument(1).getValue().toInt() and
sets(mode, s_iwoth())
sets(mode, UnixConstants::s_iwoth())
}
from Expr fc, int mode, string message