Skip to content

Commit 7cef432

Browse files
committed
add model for chownr
1 parent 578a967 commit 7cef432

File tree

4 files changed

+219
-2
lines changed

4 files changed

+219
-2
lines changed

javascript/externs/nodejs/fs.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1696,4 +1696,3 @@ module.exports.R_OK = fs.R_OK;
16961696
module.exports.W_OK = fs.W_OK;
16971697

16981698
module.exports.X_OK = fs.X_OK;
1699-

javascript/ql/lib/semmle/javascript/frameworks/Files.qll

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,18 @@ private class WriteFileAtomic extends FileSystemWriteAccess, DataFlow::CallNode
192192
override DataFlow::Node getADataNode() { result = this.getArgument(1) }
193193
}
194194

195+
/**
196+
* A call to the library `chownr`.
197+
* The library changes the owner of a file or directory recursively.
198+
*/
199+
private class Chownr extends FileSystemWriteAccess, DataFlow::CallNode {
200+
Chownr() { this = DataFlow::moduleImport("chownr").getACall() }
201+
202+
override DataFlow::Node getAPathArgument() { result = this.getArgument(0) }
203+
204+
override DataFlow::Node getADataNode() { none() }
205+
}
206+
195207
/**
196208
* A call to the library `recursive-readdir`.
197209
*/

0 commit comments

Comments
 (0)