From eb483dbac57516f2920215682d81a8319ca25a8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=BA=D0=BE=D0=B2=D0=BE=D1=80=D0=BE=D0=B4=D0=B0=20?= =?UTF-8?q?=D0=9D=D0=B8=D0=BA=D0=B8=D1=82=D0=B0=20=D0=90=D0=BD=D0=B4=D1=80?= =?UTF-8?q?=D0=B5=D0=B5=D0=B2=D0=B8=D1=87?= Date: Sun, 29 Apr 2018 21:01:58 +0300 Subject: [PATCH] fs: fchmod->fchown in promises/lchown This was a clear error. chown should do chown, not chmod. PR-URL: https://github.com/nodejs/node/pull/20407 Reviewed-By: James M Snell Reviewed-By: Benjamin Gruenbaum Reviewed-By: Tiancheng "Timothy" Gu Reviewed-By: Colin Ihrig Reviewed-By: Jamie Davis Reviewed-By: Sakthipriyan Vairamani --- lib/internal/fs/promises.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/fs/promises.js b/lib/internal/fs/promises.js index 3afd1a84985781..eb913adcbf975b 100644 --- a/lib/internal/fs/promises.js +++ b/lib/internal/fs/promises.js @@ -388,7 +388,7 @@ async function lchown(path, uid, gid) { if (O_SYMLINK !== undefined) { const fd = await open(path, O_WRONLY | O_SYMLINK); - return fchmod(fd, uid, gid).finally(fd.close.bind(fd)); + return fchown(fd, uid, gid).finally(fd.close.bind(fd)); } throw new ERR_METHOD_NOT_IMPLEMENTED(); }