File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 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 {
228228 ino = oldStat . ino ;
229229 } catch ( err ) { }
230230 if ( mode == null ) {
231- mode = 0o666 ;
231+ mode = 0o120000 ;
232232 }
233233 if ( ino == null ) {
234234 ino = this . autoinc ( ) ;
Original file line number Diff line number Diff line change @@ -390,6 +390,19 @@ describe("fs module", () => {
390390 } ) ;
391391 } ) ;
392392 } ) ;
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+ } ) ;
393406 it ( "lstat doesn't follow symlinks" , done => {
394407 fs . mkdir ( "/symlink" , ( ) => {
395408 fs . mkdir ( "/symlink/lstat" , ( ) => {
You can’t perform that action at this time.
0 commit comments