fix(s3): starting a member's workspace makes its missing folder, as the member
v2.7.3's ENOCWD left a new member no web path to a first project: their home is no workspace (EFOLDER) and a not-yet-existing folder could not start. run-as.makeMemberFolder: mkdir -p through write-as, AS the member, only inside their own home (never the home itself, never a host folder, never for a member with no account). Test: server-s3-lanes.
This commit is contained in:
@@ -2078,7 +2078,9 @@ router.post("/:id/:action", sameOriginGuard, async (req, res) => {
|
||||
if (!fs.statSync(lane.cwd).isDirectory())
|
||||
throw Object.assign(new Error(), { code: "ENOTDIR" });
|
||||
} catch (err) {
|
||||
if (err.code === "ENOENT" || err.code === "ENOTDIR") {
|
||||
// A member's new project folder is made for them, as them.
|
||||
const made = err.code === "ENOENT" && require("../lib/run-as").makeMemberFolder(lane.cwd);
|
||||
if (!made && (err.code === "ENOENT" || err.code === "ENOTDIR")) {
|
||||
return res.status(409).json({
|
||||
error: {
|
||||
code: "ENOCWD",
|
||||
|
||||
Reference in New Issue
Block a user