Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

quic: fixup test-fs-chown #360

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 12 additions & 12 deletions lib/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -1154,26 +1154,26 @@ function chmodSync(path, mode) {
function lchown(path, uid, gid, callback) {
callback = makeCallback(callback);
path = getValidatedPath(path);
validateInteger(uid, 'uid', -1, kMaxUserId);
validateInteger(gid, 'gid', -1, kMaxUserId);
validateInteger(uid, 'uid', { min: -1, max: kMaxUserId });
validateInteger(gid, 'gid', { min: -1, max: kMaxUserId });
const req = new FSReqCallback();
req.oncomplete = callback;
binding.lchown(pathModule.toNamespacedPath(path), uid, gid, req);
}

function lchownSync(path, uid, gid) {
path = getValidatedPath(path);
validateInteger(uid, 'uid', -1, kMaxUserId);
validateInteger(gid, 'gid', -1, kMaxUserId);
validateInteger(uid, 'uid', { min: -1, max: kMaxUserId });
validateInteger(gid, 'gid', { min: -1, max: kMaxUserId });
const ctx = { path };
binding.lchown(pathModule.toNamespacedPath(path), uid, gid, undefined, ctx);
handleErrorFromBinding(ctx);
}

function fchown(fd, uid, gid, callback) {
validateInt32(fd, 'fd', 0);
validateInteger(uid, 'uid', -1, kMaxUserId);
validateInteger(gid, 'gid', -1, kMaxUserId);
validateInteger(uid, 'uid', { min: -1, max: kMaxUserId });
validateInteger(gid, 'gid', { min: -1, max: kMaxUserId });

const req = new FSReqCallback();
req.oncomplete = makeCallback(callback);
Expand All @@ -1182,8 +1182,8 @@ function fchown(fd, uid, gid, callback) {

function fchownSync(fd, uid, gid) {
validateInt32(fd, 'fd', 0);
validateInteger(uid, 'uid', -1, kMaxUserId);
validateInteger(gid, 'gid', -1, kMaxUserId);
validateInteger(uid, 'uid', { min: -1, max: kMaxUserId });
validateInteger(gid, 'gid', { min: -1, max: kMaxUserId });

const ctx = {};
binding.fchown(fd, uid, gid, undefined, ctx);
Expand All @@ -1193,8 +1193,8 @@ function fchownSync(fd, uid, gid) {
function chown(path, uid, gid, callback) {
callback = makeCallback(callback);
path = getValidatedPath(path);
validateInteger(uid, 'uid', -1, kMaxUserId);
validateInteger(gid, 'gid', -1, kMaxUserId);
validateInteger(uid, 'uid', { min: -1, max: kMaxUserId });
validateInteger(gid, 'gid', { min: -1, max: kMaxUserId });

const req = new FSReqCallback();
req.oncomplete = callback;
Expand All @@ -1203,8 +1203,8 @@ function chown(path, uid, gid, callback) {

function chownSync(path, uid, gid) {
path = getValidatedPath(path);
validateInteger(uid, 'uid', -1, kMaxUserId);
validateInteger(gid, 'gid', -1, kMaxUserId);
validateInteger(uid, 'uid', { min: -1, max: kMaxUserId });
validateInteger(gid, 'gid', { min: -1, max: kMaxUserId });
const ctx = { path };
binding.chown(pathModule.toNamespacedPath(path), uid, gid, undefined, ctx);
handleErrorFromBinding(ctx);
Expand Down