File: CVE-2019-13173.diff

package info (click to toggle)
node-fstream 1.0.10-1%2Bdeb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 220 kB
  • sloc: makefile: 5
file content (20 lines) | stat: -rw-r--r-- 757 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Description: Clobber a Link if it's in the way of a File
Author: isaacs <i@izs.me>
Origin: upstream, https://github.com/npm/fstream/commit/6a77d2f
Bug: https://www.npmjs.com/advisories/886
Bug-Debian: https://bugs.debian.org/931408
Forwarded: not-needed
Reviewed-By: Xavier Guimard <yadd@debian.org>
Last-Update: 2019-08-28

--- a/lib/writer.js
+++ b/lib/writer.js
@@ -147,7 +147,7 @@
 
     // if it's a type change, then we need to clobber or error.
     // if it's not a type change, then let the impl take care of it.
-    if (currentType !== self.type) {
+    if (currentType !== self.type || self.type === 'File' && current.nlink > 1) {
       return rimraf(self._path, function (er) {
         if (er) return self.error(er)
         self._old = null