Skip to content

Commit

Permalink
quic: fixup test-fs-chown
Browse files Browse the repository at this point in the history
PR-URL: nodejs#360
Reviewed-By: Anna Henningsen <[email protected]>
  • Loading branch information
jasnell committed Mar 17, 2020
1 parent 5f0d9ba commit 8c66e50
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions lib/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -1180,26 +1180,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 @@ -1208,8 +1208,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 @@ -1219,8 +1219,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 @@ -1229,8 +1229,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

0 comments on commit 8c66e50

Please sign in to comment.