mirror of
https://github.com/github/codeql.git
synced 2025-12-18 01:33:15 +01:00
Python: Remove dubious fstat* modeling
These operate on file descriptors, and not on paths. file descriptors doesn't fit into the rest of our modeling, so I would rather remove them than to make it look like it's properly handled. I also did not include any of the functions that work on file descriptors when looking through all of `os`. So this keeps everything consistent at least ;)
This commit is contained in:
@@ -279,19 +279,13 @@ private module StdlibPrivate {
|
||||
* The `os` module has multiple methods for getting the status of a file, like
|
||||
* a stat() system call.
|
||||
*
|
||||
* Note: `os.fstat` and `os.fstatvfs` operate on file-descriptors.
|
||||
*
|
||||
* See:
|
||||
* - https://docs.python.org/3.10/library/os.html#os.stat
|
||||
* - https://docs.python.org/3.10/library/os.html#os.lstat
|
||||
* - https://docs.python.org/3.10/library/os.html#os.statvfs
|
||||
* - https://docs.python.org/3.10/library/os.html#os.fstat
|
||||
* - https://docs.python.org/3.10/library/os.html#os.fstatvfs
|
||||
*/
|
||||
private class OsProbingCall extends FileSystemAccess::Range, DataFlow::CallCfgNode {
|
||||
OsProbingCall() {
|
||||
this = os().getMember(["stat", "lstat", "statvfs", "fstat", "fstatvfs"]).getACall()
|
||||
}
|
||||
OsProbingCall() { this = os().getMember(["stat", "lstat", "statvfs"]).getACall() }
|
||||
|
||||
override DataFlow::Node getAPathArgument() {
|
||||
result in [this.getArg(0), this.getArgByName("path")]
|
||||
|
||||
Reference in New Issue
Block a user