@ai-ecoverse/slicc-kernel 1.94.3 → 1.94.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/kernel-worker.js +25 -6
- package/dist/kernel-worker.js.map +2 -2
- package/dist/node-process-worker.js +1 -1
- package/dist/node.js +26 -7
- package/dist/node.js.map +2 -2
- package/dist/process-worker.js +1 -1
- package/package.json +1 -1
package/dist/kernel-worker.js
CHANGED
|
@@ -4245,6 +4245,8 @@ var UserDb = class {
|
|
|
4245
4245
|
owners;
|
|
4246
4246
|
umasks = /* @__PURE__ */ new Map();
|
|
4247
4247
|
writing = Promise.resolve();
|
|
4248
|
+
stable;
|
|
4249
|
+
commits = 0;
|
|
4248
4250
|
constructor(fs, owners = false) {
|
|
4249
4251
|
this.fs = fs;
|
|
4250
4252
|
this.owners = owners;
|
|
@@ -4280,11 +4282,18 @@ var UserDb = class {
|
|
|
4280
4282
|
throw err;
|
|
4281
4283
|
}
|
|
4282
4284
|
}
|
|
4285
|
+
async texts() {
|
|
4286
|
+
for (; ; ) {
|
|
4287
|
+
if (this.stable) return this.stable;
|
|
4288
|
+
const commits = this.commits;
|
|
4289
|
+
const passwd = await this.read(PASSWD, DEFAULT_PASSWD);
|
|
4290
|
+
const group = await this.read(GROUP, DEFAULT_GROUP);
|
|
4291
|
+
if (this.commits === commits && !this.stable) return [passwd, group];
|
|
4292
|
+
}
|
|
4293
|
+
}
|
|
4283
4294
|
async tables() {
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
group: parseGroup(await this.read(GROUP, DEFAULT_GROUP))
|
|
4287
|
-
};
|
|
4295
|
+
const [passwd, group] = await this.texts();
|
|
4296
|
+
return { passwd: parsePasswd(passwd), group: parseGroup(group) };
|
|
4288
4297
|
}
|
|
4289
4298
|
async provision(row, umask, shared) {
|
|
4290
4299
|
const dirs = 511 & ~umask | (shared ? 1024 : 0);
|
|
@@ -4303,15 +4312,25 @@ var UserDb = class {
|
|
|
4303
4312
|
}
|
|
4304
4313
|
}
|
|
4305
4314
|
async commit(passwd, group, then) {
|
|
4306
|
-
const before = [
|
|
4315
|
+
const before = [
|
|
4316
|
+
await this.read(PASSWD, DEFAULT_PASSWD),
|
|
4317
|
+
await this.read(GROUP, DEFAULT_GROUP)
|
|
4318
|
+
];
|
|
4319
|
+
this.stable = before;
|
|
4320
|
+
this.commits++;
|
|
4307
4321
|
try {
|
|
4308
4322
|
await this.fs.writeFile(GROUP, group);
|
|
4309
4323
|
await this.fs.writeFile(PASSWD, passwd);
|
|
4324
|
+
this.stable = void 0;
|
|
4310
4325
|
await then?.();
|
|
4311
4326
|
} catch (err) {
|
|
4327
|
+
this.stable = before;
|
|
4312
4328
|
await this.fs.writeFile(GROUP, before[1]);
|
|
4313
4329
|
await this.fs.writeFile(PASSWD, before[0]);
|
|
4314
4330
|
throw err;
|
|
4331
|
+
} finally {
|
|
4332
|
+
this.stable = void 0;
|
|
4333
|
+
this.commits++;
|
|
4315
4334
|
}
|
|
4316
4335
|
}
|
|
4317
4336
|
serial(work) {
|
|
@@ -11693,7 +11712,7 @@ function mountTable(mounts = []) {
|
|
|
11693
11712
|
}
|
|
11694
11713
|
|
|
11695
11714
|
// src/version.ts
|
|
11696
|
-
var KERNEL_VERSION = true ? "1.94.
|
|
11715
|
+
var KERNEL_VERSION = true ? "1.94.4" : "0.0.0-dev";
|
|
11697
11716
|
var OS_RELEASE = "6.0.0-slicc";
|
|
11698
11717
|
function procVersion() {
|
|
11699
11718
|
return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC
|