File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -459,6 +459,7 @@ describe('Mounting', () => {
459
459
try {
460
460
await php . rmdir ( directoryMountPoint ) ;
461
461
} catch ( e : any ) {
462
+ console . log ( e ) ;
462
463
const error = e as Error ;
463
464
expect ( error . message ) . toContain (
464
465
`Could not remove directory "${ directoryMountPoint } ": Device or resource busy.`
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