Release 1.0.2
This commit is contained in:
parent
d4bfcd71c2
commit
52baa2523d
|
@ -6718,19 +6718,38 @@ function make_directory(context, path, callback) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function access_file(context, path, mode, callback) {
|
function access_file(context, path, mode, callback) {
|
||||||
|
var _Constants$fsConstant = Constants.fsConstants,
|
||||||
|
F_OK = _Constants$fsConstant.F_OK,
|
||||||
|
R_OK = _Constants$fsConstant.R_OK,
|
||||||
|
W_OK = _Constants$fsConstant.W_OK,
|
||||||
|
X_OK = _Constants$fsConstant.X_OK,
|
||||||
|
S_IXUSR = _Constants$fsConstant.S_IXUSR,
|
||||||
|
S_IXGRP = _Constants$fsConstant.S_IXGRP,
|
||||||
|
S_IXOTH = _Constants$fsConstant.S_IXOTH;
|
||||||
path = normalize(path);
|
path = normalize(path);
|
||||||
find_node(context, path, function (err, node) {
|
find_node(context, path, function (err, node) {
|
||||||
if (err) {
|
if (err) {
|
||||||
return callback(err);
|
return callback(err);
|
||||||
}
|
} // If we have a node, F_OK is true.
|
||||||
|
|
||||||
if (mode === Constants.F_OK) {
|
|
||||||
|
if (mode === F_OK) {
|
||||||
return callback(null);
|
return callback(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(mode & Constants.X_OK) || node.mode & (Constants.fsConstants.S_IXUSR | Constants.fsConstants.S_IXGRP | Constants.fsConstants.S_IXOTH)) {
|
var st_mode = validateAndMaskMode(node.mode, callback);
|
||||||
|
if (!st_mode) return; // For any other combo of F_OK, R_OK, W_OK, always allow. Filer user is a root user,
|
||||||
|
// so existing files are always OK, readable, and writable
|
||||||
|
|
||||||
|
if (mode & (R_OK | W_OK)) {
|
||||||
return callback(null);
|
return callback(null);
|
||||||
}
|
} // For the case of X_OK, actually check if this file is executable
|
||||||
|
|
||||||
|
|
||||||
|
if (mode & X_OK && st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)) {
|
||||||
|
return callback(null);
|
||||||
|
} // In any other case, the file isn't accessible
|
||||||
|
|
||||||
|
|
||||||
callback(new Errors.EACCES('permission denied', path));
|
callback(new Errors.EACCES('permission denied', path));
|
||||||
});
|
});
|
||||||
|
@ -8552,13 +8571,13 @@ function futimes(fs, context, fd, atime, mtime, callback) {
|
||||||
|
|
||||||
function chmod(fs, context, path, mode, callback) {
|
function chmod(fs, context, path, mode, callback) {
|
||||||
if (!pathCheck(path, callback)) return;
|
if (!pathCheck(path, callback)) return;
|
||||||
mode = validateAndMaskMode(mode, 'mode', callback);
|
mode = validateAndMaskMode(mode, callback);
|
||||||
if (!mode) return;
|
if (!mode) return;
|
||||||
chmod_file(context, path, mode, callback);
|
chmod_file(context, path, mode, callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
function fchmod(fs, context, fd, mode, callback) {
|
function fchmod(fs, context, fd, mode, callback) {
|
||||||
mode = validateAndMaskMode(mode, 'mode', callback);
|
mode = validateAndMaskMode(mode, callback);
|
||||||
if (!mode) return;
|
if (!mode) return;
|
||||||
var ofd = fs.openFiles[fd];
|
var ofd = fs.openFiles[fd];
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -11,7 +11,7 @@
|
||||||
"idb",
|
"idb",
|
||||||
"websql"
|
"websql"
|
||||||
],
|
],
|
||||||
"version": "1.0.1",
|
"version": "1.0.2",
|
||||||
"author": "Alan K <ack@modeswitch.org> (http://blog.modeswitch.org)",
|
"author": "Alan K <ack@modeswitch.org> (http://blog.modeswitch.org)",
|
||||||
"homepage": "http://filerjs.github.io/filer",
|
"homepage": "http://filerjs.github.io/filer",
|
||||||
"bugs": "https://github.com/filerjs/filer/issues",
|
"bugs": "https://github.com/filerjs/filer/issues",
|
||||||
|
|
Loading…
Reference in New Issue