fix super admin pi cwd double-prefixing absolute paths
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -40,7 +40,11 @@ const resolveCwd = (email: string, role: string, cwd?: string) => {
|
|||||||
const root = getHomeDirForRole(email, role);
|
const root = getHomeDirForRole(email, role);
|
||||||
if (!cwd || cwd === '~') return root;
|
if (!cwd || cwd === '~') return root;
|
||||||
if (cwd.startsWith('~/')) return join(root, cwd.slice(2));
|
if (cwd.startsWith('~/')) return join(root, cwd.slice(2));
|
||||||
if (cwd.startsWith('/')) return join(root, cwd.slice(1));
|
if (cwd.startsWith('/')) {
|
||||||
|
// Super Admin: trust absolute paths as-is
|
||||||
|
if (role === 'Super Admin') return cwd;
|
||||||
|
return join(root, cwd.slice(1));
|
||||||
|
}
|
||||||
return join(root, cwd);
|
return join(root, cwd);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user