summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'runtime')
-rw-r--r--runtime/errors.rs1
-rw-r--r--runtime/permissions/lib.rs8
2 files changed, 7 insertions, 2 deletions
diff --git a/runtime/errors.rs b/runtime/errors.rs
index 07bf694dc..a5c436e75 100644
--- a/runtime/errors.rs
+++ b/runtime/errors.rs
@@ -1086,6 +1086,7 @@ mod node {
},
OsError::Permission(e) => get_error_class_name(e).unwrap_or("Error"),
OsError::FailedToGetCpuInfo => "TypeError",
+ OsError::FailedToGetUserInfo(e) => get_io_error_class(e),
}
}
diff --git a/runtime/permissions/lib.rs b/runtime/permissions/lib.rs
index 1e1321bb2..84503f025 100644
--- a/runtime/permissions/lib.rs
+++ b/runtime/permissions/lib.rs
@@ -1368,8 +1368,12 @@ impl SysDescriptor {
match kind.as_str() {
"hostname" | "osRelease" | "osUptime" | "loadavg"
| "networkInterfaces" | "systemMemoryInfo" | "uid" | "gid" | "cpus"
- | "homedir" | "getegid" | "username" | "statfs" | "getPriority"
- | "setPriority" => Ok(Self(kind)),
+ | "homedir" | "getegid" | "statfs" | "getPriority" | "setPriority"
+ | "userInfo" => Ok(Self(kind)),
+
+ // the underlying permission check changed to `userInfo` to better match the API,
+ // alias this to avoid breaking existing projects with `--allow-sys=username`
+ "username" => Ok(Self("userInfo".into())),
_ => Err(type_error(format!("unknown system info kind \"{kind}\""))),
}
}