File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
packages/php-wasm/universal/src/lib Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -139,9 +139,13 @@ export class FSHelpers {
139
139
* To prevent the recursive option from removing internal files before
140
140
* failing to remove the mount point, we need to check if the path is a
141
141
* mount point and throw an error early.
142
+ *
143
+ * Because a mountpoint can be a symlink, we should not follow it.
144
+ * Otherwise, a mounted sylink would point to the symlinked path,
145
+ * instead of the mountpoint.
142
146
*/
143
- const mountPoint = FS . lookupPath ( path ) . node . mount ;
144
- if ( mountPoint . mountpoint === path ) {
147
+ const mountPoint = FS . lookupPath ( path , { follow : false } ) ;
148
+ if ( mountPoint ?. node . mount . mountpoint === path ) {
145
149
throw new ErrnoError ( 10 ) ;
146
150
}
147
151
You can’t perform that action at this time.
0 commit comments