@zenfs/core 1.3.1 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/backends/overlay.d.ts +1 -1
- package/dist/emulation/promises.js +1 -1
- package/dist/emulation/shared.js +3 -1
- package/dist/emulation/sync.js +1 -1
- package/dist/inode.js +2 -2
- package/package.json +1 -1
- package/src/backends/overlay.ts +1 -1
- package/src/emulation/promises.ts +2 -2
- package/src/emulation/shared.ts +3 -1
- package/src/emulation/sync.ts +1 -1
- package/src/inode.ts +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { File } from '../file.js';
|
|
2
2
|
import type { FileSystemMetadata } from '../filesystem.js';
|
|
3
3
|
import { FileSystem } from '../filesystem.js';
|
|
4
|
-
import { Stats } from '../stats.js';
|
|
4
|
+
import type { Stats } from '../stats.js';
|
|
5
5
|
/**
|
|
6
6
|
* Configuration options for OverlayFS instances.
|
|
7
7
|
*/
|
|
@@ -710,7 +710,7 @@ export async function link(targetPath, linkPath) {
|
|
|
710
710
|
if (config.checkAccess && !(await stat(dirname(linkPath))).hasAccess(constants.W_OK)) {
|
|
711
711
|
throw ErrnoError.With('EACCES', dirname(linkPath), 'link');
|
|
712
712
|
}
|
|
713
|
-
if (config.checkAccess && !(await fs.stat(path)).hasAccess(constants.
|
|
713
|
+
if (config.checkAccess && !(await fs.stat(path)).hasAccess(constants.R_OK)) {
|
|
714
714
|
throw ErrnoError.With('EACCES', path, 'link');
|
|
715
715
|
}
|
|
716
716
|
return await fs.link(path, link.path);
|
package/dist/emulation/shared.js
CHANGED
package/dist/emulation/sync.js
CHANGED
|
@@ -510,7 +510,7 @@ export function linkSync(targetPath, linkPath) {
|
|
|
510
510
|
throw ErrnoError.With('EXDEV', linkPath, 'link');
|
|
511
511
|
}
|
|
512
512
|
try {
|
|
513
|
-
if (config.checkAccess && !fs.statSync(path).hasAccess(constants.
|
|
513
|
+
if (config.checkAccess && !fs.statSync(path).hasAccess(constants.R_OK)) {
|
|
514
514
|
throw ErrnoError.With('EACCES', path, 'link');
|
|
515
515
|
}
|
|
516
516
|
return fs.linkSync(path, linkPath);
|
package/dist/inode.js
CHANGED
|
@@ -110,9 +110,9 @@ let Inode = (() => {
|
|
|
110
110
|
}
|
|
111
111
|
// Expand the buffer so it is the right size
|
|
112
112
|
if (buffer.byteLength < sz_inode) {
|
|
113
|
-
const newBuffer = new
|
|
113
|
+
const newBuffer = new Uint8Array(sz_inode);
|
|
114
114
|
// Fill the new buffer with current data
|
|
115
|
-
newBuffer.set(new
|
|
115
|
+
newBuffer.set(new Uint8Array(ArrayBuffer.isView(buffer) ? buffer.buffer : buffer));
|
|
116
116
|
/* Add a random ino.
|
|
117
117
|
This will be different from the actual one,
|
|
118
118
|
but `ino` isn't used anywhere so it should be fine.
|
package/package.json
CHANGED
package/src/backends/overlay.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { PreloadFile, parseFlag } from '../file.js';
|
|
|
5
5
|
import type { FileSystemMetadata } from '../filesystem.js';
|
|
6
6
|
import { FileSystem } from '../filesystem.js';
|
|
7
7
|
import { Mutexed } from '../mixins/mutexed.js';
|
|
8
|
-
import { Stats } from '../stats.js';
|
|
8
|
+
import type { Stats } from '../stats.js';
|
|
9
9
|
import { decodeUTF8, encodeUTF8 } from '../utils.js';
|
|
10
10
|
import type { Backend } from './backend.js';
|
|
11
11
|
/** @internal */
|
|
@@ -471,7 +471,7 @@ export async function unlink(path: fs.PathLike): Promise<void> {
|
|
|
471
471
|
path = normalizePath(path);
|
|
472
472
|
const { fs, path: resolved } = resolveMount(path);
|
|
473
473
|
try {
|
|
474
|
-
if (config.checkAccess && !(await (cache.stats.get(path) || fs.stat(resolved)))
|
|
474
|
+
if (config.checkAccess && !(await (cache.stats.get(path) || fs.stat(resolved))).hasAccess(constants.W_OK)) {
|
|
475
475
|
throw ErrnoError.With('EACCES', resolved, 'unlink');
|
|
476
476
|
}
|
|
477
477
|
await fs.unlink(resolved);
|
|
@@ -795,7 +795,7 @@ export async function link(targetPath: fs.PathLike, linkPath: fs.PathLike): Prom
|
|
|
795
795
|
throw ErrnoError.With('EACCES', dirname(linkPath), 'link');
|
|
796
796
|
}
|
|
797
797
|
|
|
798
|
-
if (config.checkAccess && !(await fs.stat(path)).hasAccess(constants.
|
|
798
|
+
if (config.checkAccess && !(await fs.stat(path)).hasAccess(constants.R_OK)) {
|
|
799
799
|
throw ErrnoError.With('EACCES', path, 'link');
|
|
800
800
|
}
|
|
801
801
|
return await fs.link(path, link.path);
|
package/src/emulation/shared.ts
CHANGED
package/src/emulation/sync.ts
CHANGED
|
@@ -524,7 +524,7 @@ export function linkSync(targetPath: fs.PathLike, linkPath: fs.PathLike): void {
|
|
|
524
524
|
throw ErrnoError.With('EXDEV', linkPath, 'link');
|
|
525
525
|
}
|
|
526
526
|
try {
|
|
527
|
-
if (config.checkAccess && !fs.statSync(path).hasAccess(constants.
|
|
527
|
+
if (config.checkAccess && !fs.statSync(path).hasAccess(constants.R_OK)) {
|
|
528
528
|
throw ErrnoError.With('EACCES', path, 'link');
|
|
529
529
|
}
|
|
530
530
|
return fs.linkSync(path, linkPath);
|
package/src/inode.ts
CHANGED
|
@@ -25,9 +25,9 @@ export class Inode implements StatsLike {
|
|
|
25
25
|
|
|
26
26
|
// Expand the buffer so it is the right size
|
|
27
27
|
if (buffer.byteLength < sz_inode) {
|
|
28
|
-
const newBuffer = new
|
|
28
|
+
const newBuffer = new Uint8Array(sz_inode);
|
|
29
29
|
// Fill the new buffer with current data
|
|
30
|
-
newBuffer.set(new
|
|
30
|
+
newBuffer.set(new Uint8Array(ArrayBuffer.isView(buffer) ? buffer.buffer : buffer));
|
|
31
31
|
/* Add a random ino.
|
|
32
32
|
This will be different from the actual one,
|
|
33
33
|
but `ino` isn't used anywhere so it should be fine.
|