@@ -26,8 +26,7 @@ const writeOnlyFolder = process.env.WRITEONLYFOLDER;
2626 fs . symlinkSync ( path . join ( readOnlyFolder , 'file' ) , path . join ( readWriteFolder , 'link-to-read-only' ) , 'file' ) ;
2727 } , common . expectsError ( {
2828 code : 'ERR_ACCESS_DENIED' ,
29- permission : 'FileSystemWrite' ,
30- resource : path . toNamespacedPath ( path . join ( readOnlyFolder , 'file' ) ) ,
29+ message : 'fs.symlink API requires full fs.read and fs.write permissions.' ,
3130 } ) ) ;
3231 assert . throws ( ( ) => {
3332 fs . linkSync ( path . join ( readOnlyFolder , 'file' ) , path . join ( readWriteFolder , 'link-to-read-only' ) ) ;
@@ -37,18 +36,6 @@ const writeOnlyFolder = process.env.WRITEONLYFOLDER;
3736 resource : path . toNamespacedPath ( path . join ( readOnlyFolder , 'file' ) ) ,
3837 } ) ) ;
3938
40- // App will be able to symlink to a writeOnlyFolder
41- fs . symlink ( path . join ( readWriteFolder , 'file' ) , path . join ( writeOnlyFolder , 'link-to-read-write' ) , 'file' , ( err ) => {
42- assert . ifError ( err ) ;
43- // App will won't be able to read the symlink
44- fs . readFile ( path . join ( writeOnlyFolder , 'link-to-read-write' ) , common . expectsError ( {
45- code : 'ERR_ACCESS_DENIED' ,
46- permission : 'FileSystemRead' ,
47- } ) ) ;
48-
49- // App will be able to write to the symlink
50- fs . writeFile ( path . join ( writeOnlyFolder , 'link-to-read-write' ) , 'some content' , common . mustSucceed ( ) ) ;
51- } ) ;
5239 fs . link ( path . join ( readWriteFolder , 'file' ) , path . join ( writeOnlyFolder , 'link-to-read-write2' ) , ( err ) => {
5340 assert . ifError ( err ) ;
5441 // App will won't be able to read the link
@@ -66,8 +53,7 @@ const writeOnlyFolder = process.env.WRITEONLYFOLDER;
6653 fs . symlinkSync ( path . join ( readWriteFolder , 'file' ) , path . join ( readOnlyFolder , 'link-to-read-only' ) , 'file' ) ;
6754 } , common . expectsError ( {
6855 code : 'ERR_ACCESS_DENIED' ,
69- permission : 'FileSystemWrite' ,
70- resource : path . toNamespacedPath ( path . join ( readOnlyFolder , 'link-to-read-only' ) ) ,
56+ message : 'fs.symlink API requires full fs.read and fs.write permissions.' ,
7157 } ) ) ;
7258 assert . throws ( ( ) => {
7359 fs . linkSync ( path . join ( readWriteFolder , 'file' ) , path . join ( readOnlyFolder , 'link-to-read-only' ) ) ;
0 commit comments