File tree Expand file tree Collapse file tree
python/ql/src/experimental/semmle/python/frameworks Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,8 +2,18 @@ private import python
22private import experimental.semmle.python.Concepts
33private import semmle.python.dataflow.new.DataFlow
44private import semmle.python.ApiGraphs
5-
5+
66private module CopyFile {
7+
8+ /**
9+ * The `shutil` module provides methods to copy or move files.
10+ * See:
11+ * - https://docs.python.org/3/library/shutil.html#shutil.copyfile
12+ * - https://docs.python.org/3/library/shutil.html#shutil.copy
13+ * - https://docs.python.org/3/library/shutil.html#shutil.copy2
14+ * - https://docs.python.org/3/library/shutil.html#shutil.copytree
15+ * - https://docs.python.org/3/library/shutil.html#shutil.move
16+ */
717 private class CopyFiles extends DataFlow:: CallCfgNode , CopyFile:: Range {
818 CopyFiles ( ) {
919 this =
@@ -18,7 +28,10 @@ private module CopyFile {
1828
1929 override DataFlow:: Node getfsrcArgument ( ) { none ( ) }
2030 }
21-
31+
32+ // TODO: once we have flow summaries, model `shutil.copyfileobj` which copies the content between its' file-like arguments.
33+ // See https://docs.python.org/3/library/shutil.html#shutil.copyfileobj
34+
2235 private class CopyFileobj extends DataFlow:: CallCfgNode , CopyFile:: Range {
2336 CopyFileobj ( ) { this = API:: moduleImport ( "shutil" ) .getMember ( "copyfileobj" ) .getACall ( ) }
2437
You can’t perform that action at this time.
0 commit comments