1- /*9/3/25: Have been doing a major update to piping logic in shell.js. The derived commands
1+ /*9/3/25: Have been doing a major update to piping logic in shell.js. The derived commands«
22should define pipeIn methods for streaming purposes, and pipeDone methods in order to
33receive every all at once in a JS array, after the EOF has been received.
44com_brep uses a highly non-trivial piping logic using Uint8Array's.
5- */
5+ » */
66//Imports«
77
88//import { util, api as capi } from "util";
@@ -439,7 +439,8 @@ return {mess: "YIM ON THE YIM YIM YIM", type: 2};
439439 let path = arr . join ( "/" ) ;
440440 parnode = await fsapi . pathToNode ( path ) ;
441441 if ( ! parnode ) return this . no ( `${ path } : no such directory` ) ;
442- if ( ! await fsapi . checkDirPerm ( path ) ) return this . no ( `${ fullpath } : permission denied` ) ;
442+ // if (!await fsapi.checkDirPerm(path)) return this.no(`${fullpath}: permission denied`);
443+ if ( ! parnode . okWrite ) return this . no ( `${ fullpath } : permission denied` ) ;
443444 val = "" ;
444445 typ = parnode . root . type ;
445446 }
@@ -676,13 +677,12 @@ async run(){
676677 err ( `${ parpath } : Not a directory` ) ;
677678 continue ;
678679 }
679-
680- let OK_TYPES = [ FS_TYPE , SHM_TYPE ] ;
680+ let OK_TYPES = [ FS_TYPE , SHM_TYPE , USERS_TYPE ] ;
681681 if ( ! OK_TYPES . includes ( parnode . type ) ) {
682682 err ( `${ fullpath } : The parent directory has an unsupported type: '${ parnode . type } '` ) ;
683683 continue ;
684684 }
685- if ( ! await fsapi . checkDirPerm ( parnode ) ) {
685+ if ( ! parnode . okWrite ) {
686686 err ( `${ path } : Permission denied` ) ;
687687 continue ;
688688 }
@@ -767,7 +767,8 @@ async run(){
767767 continue ;
768768 }
769769// if (!await fsapi.checkDirPerm(parnode)) {
770- if ( parnode . type === FS_TYPE && ! await fsapi . checkDirPerm ( parnode ) ) {
770+ if ( ! parnode . okWrite ) {
771+ // if (parnode.type === FS_TYPE && !await fsapi.checkDirPerm(parnode)) {
771772 err ( `${ fullpath } : permission denied` ) ;
772773 continue ;
773774 }
@@ -877,7 +878,8 @@ async run(){
877878 return err ( "the target node does not have an associated blob in the blob store" ) ;
878879 }
879880
880- if ( ! await fsapi . checkDirPerm ( target_node . par ) ) {
881+ // if (!await fsapi.checkDirPerm(target_node.par)) {
882+ if ( ! target_node . par . okWrite ) {
881883 return err ( `${ target_node . par . fullpath } : permission denied` ) ;
882884 }
883885
@@ -897,7 +899,8 @@ async run(){
897899 if ( parnode . type !== FS_TYPE ) {
898900 return err ( `${ fullpath } : the parent directory is not of type '${ FS_TYPE } '` ) ;
899901 }
900- if ( ! await fsapi . checkDirPerm ( parnode ) ) {
902+ // if (!await fsapi.checkDirPerm(parnode)) {
903+ if ( ! parnode . okWrite ) {
901904 return err ( `${ path } : permission denied` ) ;
902905 }
903906 let newnode = await fsapi . makeHardLink ( parnode , fname , blobid ) ;
@@ -943,7 +946,8 @@ async run(){
943946 if ( parnode . type !== FS_TYPE ) {
944947 return err ( `${ fullpath } : the parent directory is not of type '${ FS_TYPE } '` ) ;
945948 }
946- if ( ! await fsapi . checkDirPerm ( parnode ) ) {
949+ // if (!await fsapi.checkDirPerm(parnode)) {
950+ if ( ! parnode . okWrite ) {
947951 return err ( `${ path } : permission denied` ) ;
948952 }
949953 let newnode = await fsapi . makeLink ( parnode , fname , target , normPath ( target , this . term . cur_dir ) ) ;
0 commit comments