File tree 2 files changed +14
-1
lines changed
2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -228,7 +228,7 @@ module.exports = class CacheFS {
228
228
ino = oldStat . ino ;
229
229
} catch ( err ) { }
230
230
if ( mode == null ) {
231
- mode = 0o666 ;
231
+ mode = 0o120000 ;
232
232
}
233
233
if ( ino == null ) {
234
234
ino = this . autoinc ( ) ;
Original file line number Diff line number Diff line change @@ -390,6 +390,19 @@ describe("fs module", () => {
390
390
} ) ;
391
391
} ) ;
392
392
} ) ;
393
+ it ( "lstat for symlink creates correct mode" , done => {
394
+ fs . mkdir ( "/symlink" , ( ) => {
395
+ fs . writeFile ( "/symlink/a.txt" , "hello" , ( ) => {
396
+ fs . symlink ( "/symlink/a.txt" , "/symlink/b.txt" , ( ) => {
397
+ fs . lstat ( "/symlink/b.txt" , ( err , stat ) => {
398
+ expect ( err ) . toBe ( null )
399
+ expect ( stat . mode ) . toBe ( 0o120000 )
400
+ done ( ) ;
401
+ } ) ;
402
+ } ) ;
403
+ } ) ;
404
+ } ) ;
405
+ } ) ;
393
406
it ( "lstat doesn't follow symlinks" , done => {
394
407
fs . mkdir ( "/symlink" , ( ) => {
395
408
fs . mkdir ( "/symlink/lstat" , ( ) => {
You can’t perform that action at this time.
0 commit comments