mirror of
https://github.com/HeyPuter/puter.git
synced 2026-01-10 23:20:21 -06:00
fix: handle subpaths under another user
This commit is contained in:
@@ -162,6 +162,17 @@ module.exports = class FSNodeContext {
|
||||
if ( this.found === false ) return undefined;
|
||||
return ! this.entry.parent_uid;
|
||||
}
|
||||
|
||||
async getUserPart () {
|
||||
if ( this.isRoot ) return;
|
||||
|
||||
let path = await this.get('path');
|
||||
if ( path.startsWith('/') ) path = path.slice(1);
|
||||
const components = path.split('/');
|
||||
const userpart = components[0];
|
||||
|
||||
return userpart;
|
||||
}
|
||||
|
||||
async exists (fetch_options = {}) {
|
||||
await this.fetchEntry();
|
||||
|
||||
@@ -53,8 +53,7 @@ class HLReadDir extends HLFilesystemOperation {
|
||||
const ll_listusers = new LLListUsers();
|
||||
children = await ll_listusers.run(this.values);
|
||||
} else if (
|
||||
await subject.isUserDirectory() &&
|
||||
await subject.get('name') !== user.username
|
||||
await subject.getUserPart() !== user.username
|
||||
) {
|
||||
this.log.noticeme('THIS HAPPEN');
|
||||
const ll_readshares = new LLReadShares();
|
||||
|
||||
Reference in New Issue
Block a user