kobako 0.29.0 → 0.31.0
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.
- checksums.yaml +4 -4
- data/.release-please-manifest.json +1 -1
- data/CHANGELOG.md +552 -10
- data/Cargo.lock +595 -139
- data/README.md +126 -564
- data/ROADMAP.md +3 -2
- data/crates/kobako-runtime/CHANGELOG.md +488 -1
- data/crates/kobako-runtime/Cargo.toml +73 -15
- data/crates/kobako-runtime/README.md +11 -4
- data/crates/kobako-runtime/src/cred.rs +124 -0
- data/crates/kobako-runtime/src/dispatch.rs +5 -6
- data/crates/kobako-runtime/src/endpoint/buffer.rs +301 -0
- data/crates/kobako-runtime/src/endpoint/dispatch.rs +292 -0
- data/crates/kobako-runtime/src/endpoint/invoke.rs +181 -0
- data/crates/kobako-runtime/src/endpoint.rs +267 -0
- data/crates/kobako-runtime/src/errno.rs +391 -0
- data/crates/kobako-runtime/src/error.rs +31 -10
- data/crates/kobako-runtime/src/filesystem/anon_inodes.rs +52 -0
- data/crates/kobako-runtime/src/filesystem/bind/fid.rs +82 -0
- data/crates/kobako-runtime/src/filesystem/bind/lookup.rs +274 -0
- data/crates/kobako-runtime/src/filesystem/bind/walk.rs +248 -0
- data/crates/kobako-runtime/src/filesystem/bind.rs +2857 -0
- data/crates/kobako-runtime/src/filesystem/overlay/file.rs +89 -0
- data/crates/kobako-runtime/src/filesystem/overlay/inode.rs +106 -0
- data/crates/kobako-runtime/src/filesystem/overlay/path.rs +263 -0
- data/crates/kobako-runtime/src/filesystem/overlay/stack/copy_up.rs +128 -0
- data/crates/kobako-runtime/src/filesystem/overlay/stack/dir.rs +238 -0
- data/crates/kobako-runtime/src/filesystem/overlay/stack/namei.rs +135 -0
- data/crates/kobako-runtime/src/filesystem/overlay/stack/readdir.rs +54 -0
- data/crates/kobako-runtime/src/filesystem/overlay/stack.rs +316 -739
- data/crates/kobako-runtime/src/filesystem/overlay.rs +2627 -1154
- data/crates/kobako-runtime/src/filesystem/pipe.rs +224 -0
- data/crates/kobako-runtime/src/filesystem/rdir.rs +84 -0
- data/crates/kobako-runtime/src/filesystem/tmpfs/seed.rs +32 -0
- data/crates/kobako-runtime/src/filesystem/tmpfs/tmpfile.rs +32 -0
- data/crates/kobako-runtime/src/filesystem/tmpfs/whiteout.rs +107 -0
- data/crates/kobako-runtime/src/filesystem/tmpfs/xattr.rs +22 -0
- data/crates/kobako-runtime/src/filesystem/tmpfs.rs +1997 -0
- data/crates/kobako-runtime/src/filesystem/wrap.rs +208 -0
- data/crates/kobako-runtime/src/filesystem.rs +25 -388
- data/crates/kobako-runtime/src/fork.rs +96 -0
- data/crates/kobako-runtime/src/grant.rs +3 -0
- data/crates/kobako-runtime/src/hashtable.rs +46 -0
- data/crates/kobako-runtime/src/lib.rs +27 -11
- data/crates/kobako-runtime/src/limits.rs +195 -0
- data/crates/kobako-runtime/src/locking/seqlock.rs +66 -0
- data/crates/kobako-runtime/src/locking.rs +228 -0
- data/crates/kobako-runtime/src/memcg.rs +383 -0
- data/crates/kobako-runtime/src/mount.rs +86 -101
- data/crates/kobako-runtime/src/net/backends.rs +43 -0
- data/crates/kobako-runtime/src/net/connections.rs +179 -0
- data/crates/kobako-runtime/src/net/credential.rs +125 -0
- data/crates/kobako-runtime/src/net/egress.rs +160 -0
- data/crates/kobako-runtime/src/net/family.rs +181 -0
- data/crates/kobako-runtime/src/net/http.rs +2733 -0
- data/crates/kobako-runtime/src/net/lookup.rs +285 -0
- data/crates/kobako-runtime/src/net/mock.rs +251 -0
- data/crates/kobako-runtime/src/net/namespace.rs +1366 -0
- data/crates/kobako-runtime/src/net/reactor.rs +531 -0
- data/crates/kobako-runtime/src/net/resolv/darwin.rs +275 -0
- data/crates/kobako-runtime/src/net/resolv/stub/tests.rs +469 -0
- data/crates/kobako-runtime/src/net/resolv/stub.rs +536 -0
- data/crates/kobako-runtime/src/net/resolv/windows.rs +248 -0
- data/crates/kobako-runtime/src/net/resolv.rs +227 -0
- data/crates/kobako-runtime/src/net/socket.rs +870 -0
- data/crates/kobako-runtime/src/net/tcp.rs +1588 -0
- data/crates/kobako-runtime/src/net/tls.rs +58 -0
- data/crates/kobako-runtime/src/net/transport.rs +279 -0
- data/crates/kobako-runtime/src/net/udp.rs +1003 -0
- data/crates/kobako-runtime/src/net.rs +42 -0
- data/crates/kobako-runtime/src/network/builder.rs +177 -0
- data/crates/kobako-runtime/src/network/ruleset.rs +777 -0
- data/crates/kobako-runtime/src/network.rs +551 -0
- data/crates/kobako-runtime/src/policy.rs +16 -0
- data/crates/kobako-runtime/src/profile.rs +37 -16
- data/crates/kobako-runtime/src/runtime.rs +3 -5
- data/crates/kobako-runtime/src/sched.rs +311 -0
- data/crates/kobako-runtime/src/security/entry_policy.rs +22 -0
- data/crates/kobako-runtime/src/security/hooks.rs +242 -0
- data/crates/kobako-runtime/src/security/mount_policy.rs +158 -0
- data/crates/kobako-runtime/src/security.rs +601 -0
- data/crates/kobako-runtime/src/snapshot.rs +121 -2
- data/crates/kobako-runtime/src/vfs/attr.rs +162 -0
- data/crates/kobako-runtime/src/vfs/dentry.rs +1466 -0
- data/crates/kobako-runtime/src/vfs/file.rs +1911 -0
- data/crates/kobako-runtime/src/vfs/inode.rs +425 -0
- data/crates/kobako-runtime/src/vfs/kern_path.rs +213 -0
- data/crates/kobako-runtime/src/vfs/mount.rs +60 -0
- data/crates/kobako-runtime/src/vfs/namei.rs +5837 -0
- data/crates/kobako-runtime/src/vfs/namespace.rs +162 -0
- data/crates/kobako-runtime/src/vfs/open_files.rs +69 -0
- data/crates/kobako-runtime/src/vfs/openat2.rs +116 -0
- data/crates/kobako-runtime/src/vfs/path.rs +64 -0
- data/crates/kobako-runtime/src/vfs/readdir.rs +163 -0
- data/crates/kobako-runtime/src/vfs/stat.rs +293 -0
- data/crates/kobako-runtime/src/vfs/super_block.rs +126 -0
- data/crates/kobako-runtime/src/vfs/utimes.rs +299 -0
- data/crates/kobako-runtime/src/vfs.rs +63 -0
- data/crates/kobako-runtime/src/wait.rs +356 -0
- data/crates/kobako-transport/CHANGELOG.md +39 -2
- data/crates/kobako-transport/Cargo.toml +3 -3
- data/crates/kobako-transport/README.md +8 -8
- data/crates/kobako-transport/src/abi.rs +78 -72
- data/crates/kobako-transport/src/envelope/bytes.rs +49 -30
- data/crates/kobako-transport/src/envelope/call.rs +37 -9
- data/crates/kobako-transport/src/envelope/compile_reply.rs +2 -2
- data/crates/kobako-transport/src/envelope/error_record.rs +24 -3
- data/crates/kobako-transport/src/envelope/fault.rs +2 -2
- data/crates/kobako-transport/src/envelope/name.rs +99 -0
- data/crates/kobako-transport/src/envelope/outcome.rs +11 -11
- data/crates/kobako-transport/src/envelope/preamble.rs +34 -31
- data/crates/kobako-transport/src/envelope/reply.rs +29 -29
- data/crates/kobako-transport/src/envelope/request.rs +2 -2
- data/crates/kobako-transport/src/envelope/run.rs +1 -1
- data/crates/kobako-transport/src/envelope/unsupported.rs +12 -12
- data/crates/kobako-transport/src/envelope.rs +15 -10
- data/crates/kobako-wasmtime/CHANGELOG.md +315 -8
- data/crates/kobako-wasmtime/Cargo.toml +35 -15
- data/crates/kobako-wasmtime/README.md +11 -6
- data/crates/kobako-wasmtime/build/preview2.rs +1339 -0
- data/crates/kobako-wasmtime/build.rs +16 -0
- data/crates/kobako-wasmtime/src/abi.rs +19 -47
- data/crates/kobako-wasmtime/src/ambient.rs +33 -19
- data/crates/kobako-wasmtime/src/cache.rs +28 -20
- data/crates/kobako-wasmtime/src/config.rs +59 -60
- data/crates/kobako-wasmtime/src/driver.rs +63 -145
- data/crates/kobako-wasmtime/src/exports.rs +147 -32
- data/crates/kobako-wasmtime/src/guest.rs +44 -0
- data/crates/kobako-wasmtime/src/guest_binary.rs +14 -0
- data/crates/kobako-wasmtime/src/imports.rs +48 -18
- data/crates/kobako-wasmtime/src/instance_pre.rs +7 -7
- data/crates/kobako-wasmtime/src/invocation.rs +93 -51
- data/crates/kobako-wasmtime/src/lib.rs +6 -7
- data/crates/kobako-wasmtime/src/limiter.rs +52 -211
- data/crates/kobako-wasmtime/src/preview1/descriptors.rs +309 -0
- data/crates/kobako-wasmtime/src/preview1/differential/mount.rs +70 -57
- data/crates/kobako-wasmtime/src/preview1/differential.rs +137 -27
- data/crates/kobako-wasmtime/src/preview1/errno.rs +90 -233
- data/crates/kobako-wasmtime/src/preview1/fd.rs +1301 -522
- data/crates/kobako-wasmtime/src/preview1/memory.rs +126 -150
- data/crates/kobako-wasmtime/src/preview1/mount_view/wrap.rs +192 -0
- data/crates/kobako-wasmtime/src/preview1/mount_view.rs +1989 -708
- data/crates/kobako-wasmtime/src/preview1/path.rs +181 -365
- data/crates/kobako-wasmtime/src/preview1/poll.rs +345 -173
- data/crates/kobako-wasmtime/src/preview1/sock.rs +10 -25
- data/crates/kobako-wasmtime/src/preview1/testsuite-expected.txt +6 -0
- data/crates/kobako-wasmtime/src/preview1/testsuite.rs +147 -0
- data/crates/kobako-wasmtime/src/preview1.rs +471 -416
- data/crates/kobako-wasmtime/src/preview2/abi.rs +227 -0
- data/crates/kobako-wasmtime/src/preview2/error.rs +118 -0
- data/crates/kobako-wasmtime/src/preview2/filesystem.rs +122 -0
- data/crates/kobako-wasmtime/src/preview2/host.rs +3959 -0
- data/crates/kobako-wasmtime/src/preview2/http.rs +1503 -0
- data/crates/kobako-wasmtime/src/preview2/io.rs +315 -0
- data/crates/kobako-wasmtime/src/preview2/sockets.rs +379 -0
- data/crates/kobako-wasmtime/src/preview2/table.rs +305 -0
- data/crates/kobako-wasmtime/src/preview2.rs +57 -0
- data/crates/kobako-wasmtime/src/trap.rs +31 -16
- data/crates/kobako-wasmtime/src/wasi.rs +238 -93
- data/crates/kobako-wasmtime/wit/deps/cli.wit +233 -0
- data/crates/kobako-wasmtime/wit/deps/clocks.wit +162 -0
- data/crates/kobako-wasmtime/wit/deps/filesystem.wit +589 -0
- data/crates/kobako-wasmtime/wit/deps/http.wit +733 -0
- data/crates/kobako-wasmtime/wit/deps/io.wit +299 -0
- data/crates/kobako-wasmtime/wit/deps/random.wit +92 -0
- data/crates/kobako-wasmtime/wit/deps/sockets.wit +949 -0
- data/crates/kobako-wasmtime/witx/typenames.witx +750 -0
- data/crates/kobako-wasmtime/witx/wasi_snapshot_preview1.witx +441 -0
- data/data/kobako.wasm +0 -0
- data/ext/kobako/Cargo.toml +1 -1
- data/ext/kobako/src/{runtime/errors.rs → errors.rs} +35 -27
- data/ext/kobako/src/escape.rs +98 -0
- data/ext/kobako/src/{runtime/filesystem → filesystem}/grants.rs +36 -16
- data/ext/kobako/src/filesystem/ruby.rs +689 -0
- data/ext/kobako/src/filesystem.rs +217 -0
- data/ext/kobako/src/gvl.rs +306 -0
- data/ext/kobako/src/lib.rs +64 -3
- data/ext/kobako/src/network/mock.rs +187 -0
- data/ext/kobako/src/network.rs +591 -0
- data/ext/kobako/src/runtime/bridge.rs +31 -30
- data/ext/kobako/src/runtime/snapshot.rs +5 -5
- data/ext/kobako/src/runtime.rs +221 -138
- data/ext/kobako/src/wire.rs +42 -0
- data/lib/kobako/catalog/extensions.rb +19 -7
- data/lib/kobako/catalog/flags.rb +4 -6
- data/lib/kobako/catalog/grants.rb +5 -4
- data/lib/kobako/catalog/handles.rb +9 -31
- data/lib/kobako/catalog/mount.rb +12 -12
- data/lib/kobako/catalog/network.rb +35 -0
- data/lib/kobako/catalog/replacements.rb +28 -0
- data/lib/kobako/catalog/services.rb +7 -21
- data/lib/kobako/catalog/snippets.rb +10 -25
- data/lib/kobako/catalog.rb +4 -1
- data/lib/kobako/codec/{utils.rb → boundary.rb} +5 -3
- data/lib/kobako/codec/decoder.rb +12 -12
- data/lib/kobako/codec/ext_types.rb +5 -7
- data/lib/kobako/codec/handle_walk.rb +5 -47
- data/lib/kobako/codec/nesting.rb +7 -7
- data/lib/kobako/codec/value_budget.rb +134 -42
- data/lib/kobako/codec.rb +1 -1
- data/lib/kobako/context.rb +28 -15
- data/lib/kobako/errors.rb +15 -12
- data/lib/kobako/extension.rb +3 -2
- data/lib/kobako/filesystem.rb +53 -15
- data/lib/kobako/handle.rb +2 -2
- data/lib/kobako/names.rb +28 -0
- data/lib/kobako/network.rb +210 -0
- data/lib/kobako/outcome.rb +7 -7
- data/lib/kobako/payload/arguments.rb +2 -2
- data/lib/kobako/pool.rb +47 -25
- data/lib/kobako/runtime.rb +3 -2
- data/lib/kobako/sandbox.rb +113 -56
- data/lib/kobako/sandbox_options.rb +41 -107
- data/lib/kobako/snippet/bytecode.rb +1 -1
- data/lib/kobako/snippet/source.rb +1 -1
- data/lib/kobako/transport/argument_wrap.rb +64 -0
- data/lib/kobako/transport/block_failure.rb +1 -1
- data/lib/kobako/transport/dispatcher.rb +10 -10
- data/lib/kobako/transport/exposure.rb +28 -17
- data/lib/kobako/transport/reflection.rb +28 -11
- data/lib/kobako/transport/run.rb +13 -28
- data/lib/kobako/transport/yielder.rb +3 -10
- data/lib/kobako/transport.rb +1 -0
- data/lib/kobako/version.rb +1 -1
- data/lib/kobako.rb +38 -0
- data/release-please-config.json +16 -0
- data/sig/core/thread.rbs +6 -0
- data/sig/kobako/catalog/extensions.rbs +5 -3
- data/sig/kobako/catalog/grants.rbs +7 -4
- data/sig/kobako/catalog/handles.rbs +2 -4
- data/sig/kobako/catalog/mount.rbs +3 -5
- data/sig/kobako/catalog/network.rbs +20 -0
- data/sig/kobako/catalog/replacements.rbs +14 -0
- data/sig/kobako/catalog/services.rbs +1 -5
- data/sig/kobako/catalog/snippets.rbs +3 -5
- data/sig/kobako/catalog.rbs +1 -1
- data/sig/kobako/codec/boundary.rbs +9 -0
- data/sig/kobako/codec/decoder.rbs +1 -1
- data/sig/kobako/codec/handle_walk.rbs +0 -6
- data/sig/kobako/codec/nesting.rbs +2 -2
- data/sig/kobako/codec/value_budget.rbs +48 -5
- data/sig/kobako/codec.rbs +1 -2
- data/sig/kobako/context.rbs +4 -2
- data/sig/kobako/errors.rbs +4 -4
- data/sig/kobako/filesystem.rbs +38 -15
- data/sig/kobako/guest_yielder.rbs +1 -1
- data/sig/kobako/network.rbs +115 -0
- data/sig/kobako/outcome.rbs +1 -1
- data/sig/kobako/payload/arguments.rbs +1 -1
- data/sig/kobako/pool.rbs +8 -4
- data/sig/kobako/runtime.rbs +32 -3
- data/sig/kobako/sandbox.rbs +22 -7
- data/sig/kobako/sandbox_options.rbs +29 -38
- data/sig/kobako/transport/argument_wrap.rbs +15 -0
- data/sig/kobako/transport/dispatcher.rbs +2 -2
- data/sig/kobako/transport/error.rbs +1 -1
- data/sig/kobako/transport/exposure.rbs +3 -5
- data/sig/kobako/transport/reflection.rbs +12 -2
- data/sig/kobako/transport/run.rbs +3 -5
- data/sig/kobako/transport/yielder.rbs +0 -3
- data/sig/kobako/transport.rbs +2 -2
- data/sig/kobako.rbs +13 -0
- metadata +131 -34
- data/crates/kobako-runtime/src/filesystem/directory/spelling.rs +0 -194
- data/crates/kobako-runtime/src/filesystem/directory.rs +0 -1082
- data/crates/kobako-runtime/src/filesystem/memory.rs +0 -1100
- data/crates/kobako-runtime/src/filesystem/overlay/exclusive.rs +0 -88
- data/crates/kobako-runtime/src/filesystem/path.rs +0 -60
- data/crates/kobako-runtime/src/filesystem/temporary.rs +0 -167
- data/crates/kobako-wasmtime/src/capture.rs +0 -96
- data/crates/kobako-wasmtime/src/descriptors.rs +0 -167
- data/crates/kobako-wasmtime/src/dispatch.rs +0 -125
- data/crates/kobako-wasmtime/src/guest_mem.rs +0 -271
- data/crates/kobako-wasmtime/src/io.rs +0 -89
- data/crates/kobako-wasmtime/src/preview1/args.rs +0 -60
- data/crates/kobako-wasmtime/src/preview1/beneath.rs +0 -188
- data/crates/kobako-wasmtime/tests/compile_posture.rs +0 -43
- data/crates/kobako-wasmtime/tests/guest_file.rs +0 -1054
- data/crates/kobako-wasmtime/tests/preamble_flags.rs +0 -70
- data/crates/kobako-wasmtime/tests/snippet_compile.rs +0 -95
- data/crates/kobako-wasmtime/tests/support/mod.rs +0 -30
- data/crates/kobako-wasmtime/tests/unanswered_call.rs +0 -86
- data/crates/kobako-wasmtime/tests/unsupported_call.rs +0 -51
- data/ext/kobako/src/runtime/escape.rs +0 -53
- data/ext/kobako/src/runtime/filesystem/ruby.rs +0 -400
- data/ext/kobako/src/runtime/filesystem.rs +0 -236
- data/ext/kobako/src/runtime/gvl.rs +0 -112
- data/lib/kobako/constant_name.rb +0 -8
- data/sig/kobako/codec/utils.rbs +0 -9
- data/sig/kobako/constant_name.rbs +0 -3
- /data/ext/kobako/src/{runtime/pinned_value.rs → pinned_value.rs} +0 -0
|
@@ -2,10 +2,6 @@ module Kobako
|
|
|
2
2
|
module Transport
|
|
3
3
|
class Exposure < Data
|
|
4
4
|
PREDICATE: Symbol
|
|
5
|
-
CLASS_OF: UnboundMethod
|
|
6
|
-
SINGLETON_CLASS_OF: UnboundMethod
|
|
7
|
-
SINGLETON_METHODS: UnboundMethod
|
|
8
|
-
PRIVATE_METHODS: UnboundMethod
|
|
9
5
|
CALLABLE: Set[Symbol]
|
|
10
6
|
NOTHING: Set[Symbol]
|
|
11
7
|
|
|
@@ -17,6 +13,8 @@ module Kobako
|
|
|
17
13
|
|
|
18
14
|
def self.of: (untyped object, ?Hash[Module, Set[Symbol]] surfaces) -> Exposure
|
|
19
15
|
|
|
16
|
+
def self.refused_class_of: (untyped object) -> Module?
|
|
17
|
+
|
|
20
18
|
def initialize: (object: untyped, names: Set[Symbol]?) -> void
|
|
21
19
|
|
|
22
20
|
def with: (?object: untyped, ?names: Set[Symbol]?) -> Exposure
|
|
@@ -31,7 +29,7 @@ module Kobako
|
|
|
31
29
|
|
|
32
30
|
def self.narrows_itself?: (untyped object, Module klass) -> bool
|
|
33
31
|
|
|
34
|
-
def self.
|
|
32
|
+
def self.resolve_default_names: (untyped object, Module klass, Hash[Module, Set[Symbol]] surfaces) -> Set[Symbol]
|
|
35
33
|
|
|
36
34
|
def self.class_names: (untyped object, Module klass) -> Set[Symbol]
|
|
37
35
|
|
|
@@ -3,6 +3,14 @@ module Kobako
|
|
|
3
3
|
module Reflection
|
|
4
4
|
GADGET_OWNERS: Array[Module]
|
|
5
5
|
CALLABLE_ALLOW: Array[Symbol]
|
|
6
|
+
CLASS_OF: UnboundMethod
|
|
7
|
+
IS_A: UnboundMethod
|
|
8
|
+
SINGLETON_CLASS_OF: UnboundMethod
|
|
9
|
+
SINGLETON_METHODS: UnboundMethod
|
|
10
|
+
PRIVATE_METHODS: UnboundMethod
|
|
11
|
+
RESPOND_TO: UnboundMethod
|
|
12
|
+
PUBLIC_SEND: UnboundMethod
|
|
13
|
+
SEND: UnboundMethod
|
|
6
14
|
|
|
7
15
|
def self.refusal: (Kobako::Transport::Exposure exposure, Symbol name) -> String?
|
|
8
16
|
|
|
@@ -14,16 +22,18 @@ module Kobako
|
|
|
14
22
|
|
|
15
23
|
def self.ambient_refusal: (untyped target, Symbol name) -> String?
|
|
16
24
|
|
|
17
|
-
def self.
|
|
25
|
+
def self.public_method_refusal: (untyped target, Symbol name, Module klass) -> String?
|
|
18
26
|
|
|
19
27
|
def self.authored_for?: (untyped target, Symbol name, UnboundMethod method, Module klass) -> bool
|
|
20
28
|
|
|
21
|
-
def self.
|
|
29
|
+
def self.service_refusal: (Symbol name) -> String
|
|
22
30
|
|
|
23
31
|
def self.owner_refusal: (untyped target, Symbol name, Module owner) -> String?
|
|
24
32
|
|
|
25
33
|
def self.lookup_class: (untyped target) -> Module
|
|
26
34
|
|
|
35
|
+
def self.module?: (untyped target) -> bool
|
|
36
|
+
|
|
27
37
|
def self.ambient_owner?: (Module owner, untyped target) -> bool
|
|
28
38
|
end
|
|
29
39
|
end
|
|
@@ -9,15 +9,13 @@ module Kobako
|
|
|
9
9
|
|
|
10
10
|
def initialize: (entrypoint: Symbol | String, ?args: Array[untyped], ?kwargs: Hash[untyped, untyped]) -> void
|
|
11
11
|
|
|
12
|
-
def
|
|
12
|
+
def encode_payload: (Kobako::Codec::_HandleTable handles) -> String
|
|
13
13
|
|
|
14
14
|
private
|
|
15
15
|
|
|
16
|
-
def
|
|
16
|
+
def validate_args: (Array[untyped] args) -> void
|
|
17
17
|
|
|
18
|
-
def
|
|
19
|
-
|
|
20
|
-
def validate_kwargs!: (Hash[untyped, untyped] kwargs) -> void
|
|
18
|
+
def validate_kwargs: (Hash[untyped, untyped] kwargs) -> void
|
|
21
19
|
|
|
22
20
|
def forged_handle_message: (String slot) -> String
|
|
23
21
|
end
|
|
@@ -5,7 +5,6 @@ module Kobako
|
|
|
5
5
|
@break_tag: Symbol
|
|
6
6
|
@handles: Kobako::Codec::_HandleTable
|
|
7
7
|
@failure: Kobako::Transport::BlockFailure
|
|
8
|
-
@active: bool
|
|
9
8
|
|
|
10
9
|
def initialize: (Kobako::Transport::_GuestYielder guest_yielder, Symbol break_tag, Kobako::Codec::_HandleTable handles, Kobako::Transport::BlockFailure failure) -> void
|
|
11
10
|
|
|
@@ -13,8 +12,6 @@ module Kobako
|
|
|
13
12
|
|
|
14
13
|
def to_proc: () -> Proc
|
|
15
14
|
|
|
16
|
-
def invalidate: () -> void
|
|
17
|
-
|
|
18
15
|
private
|
|
19
16
|
|
|
20
17
|
def encode_args: (Array[untyped] args) -> String
|
data/sig/kobako/transport.rbs
CHANGED
|
@@ -2,7 +2,7 @@ module Kobako
|
|
|
2
2
|
module Transport
|
|
3
3
|
# The guest re-entry callable a dispatch hands to a Yielder: invoked
|
|
4
4
|
# with the encoded yield args, it returns the decoded Yield Reply as an
|
|
5
|
-
# +[arm, body,
|
|
5
|
+
# +[arm, body, class_name]+ triple.
|
|
6
6
|
# The ext's Kobako::GuestYielder is the production conformer;
|
|
7
7
|
# modelled structurally so the Transport layer needs no upward
|
|
8
8
|
# dependency on Runtime.
|
|
@@ -11,7 +11,7 @@ module Kobako
|
|
|
11
11
|
end
|
|
12
12
|
|
|
13
13
|
# The per-invocation dispatch Proc, taking the routing fields the native
|
|
14
|
-
# side already decoded off the
|
|
14
|
+
# side already decoded off the Envelope and answering the arm and
|
|
15
15
|
# body it puts on the Reply. Named here so the producer (Context) and the
|
|
16
16
|
# consumer (Runtime) cannot declare it differently.
|
|
17
17
|
type dispatch_proc = ^(String | Integer, String, bool, String, _GuestYielder) -> [Symbol, String, String?]
|
data/sig/kobako.rbs
CHANGED
|
@@ -1,2 +1,15 @@
|
|
|
1
1
|
module Kobako
|
|
2
|
+
def self.to_name: (untyped name, String what) -> String
|
|
3
|
+
|
|
4
|
+
def self.to_constant_name: (untyped name, String what) -> Symbol
|
|
5
|
+
|
|
6
|
+
def self.constant_name?: (String name) -> bool
|
|
7
|
+
|
|
8
|
+
def self.constant_path?: (String path) -> bool
|
|
9
|
+
|
|
10
|
+
def self.reserved_path?: (String path) -> bool
|
|
11
|
+
|
|
12
|
+
def self.paths_collide?: (String path, String bound) -> bool
|
|
13
|
+
|
|
14
|
+
def self.max_handle_id: () -> Integer
|
|
2
15
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kobako
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.31.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Aotokitsuruya
|
|
@@ -15,7 +15,7 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - ">="
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: 1.8.
|
|
18
|
+
version: 1.8.6
|
|
19
19
|
- - "<"
|
|
20
20
|
- !ruby/object:Gem::Version
|
|
21
21
|
version: '2'
|
|
@@ -25,7 +25,7 @@ dependencies:
|
|
|
25
25
|
requirements:
|
|
26
26
|
- - ">="
|
|
27
27
|
- !ruby/object:Gem::Version
|
|
28
|
-
version: 1.8.
|
|
28
|
+
version: 1.8.6
|
|
29
29
|
- - "<"
|
|
30
30
|
- !ruby/object:Gem::Version
|
|
31
31
|
version: '2'
|
|
@@ -64,23 +64,96 @@ files:
|
|
|
64
64
|
- crates/kobako-runtime/CHANGELOG.md
|
|
65
65
|
- crates/kobako-runtime/Cargo.toml
|
|
66
66
|
- crates/kobako-runtime/README.md
|
|
67
|
+
- crates/kobako-runtime/src/cred.rs
|
|
67
68
|
- crates/kobako-runtime/src/dispatch.rs
|
|
69
|
+
- crates/kobako-runtime/src/endpoint.rs
|
|
70
|
+
- crates/kobako-runtime/src/endpoint/buffer.rs
|
|
71
|
+
- crates/kobako-runtime/src/endpoint/dispatch.rs
|
|
72
|
+
- crates/kobako-runtime/src/endpoint/invoke.rs
|
|
73
|
+
- crates/kobako-runtime/src/errno.rs
|
|
68
74
|
- crates/kobako-runtime/src/error.rs
|
|
69
75
|
- crates/kobako-runtime/src/filesystem.rs
|
|
70
|
-
- crates/kobako-runtime/src/filesystem/
|
|
71
|
-
- crates/kobako-runtime/src/filesystem/
|
|
72
|
-
- crates/kobako-runtime/src/filesystem/
|
|
76
|
+
- crates/kobako-runtime/src/filesystem/anon_inodes.rs
|
|
77
|
+
- crates/kobako-runtime/src/filesystem/bind.rs
|
|
78
|
+
- crates/kobako-runtime/src/filesystem/bind/fid.rs
|
|
79
|
+
- crates/kobako-runtime/src/filesystem/bind/lookup.rs
|
|
80
|
+
- crates/kobako-runtime/src/filesystem/bind/walk.rs
|
|
73
81
|
- crates/kobako-runtime/src/filesystem/overlay.rs
|
|
74
|
-
- crates/kobako-runtime/src/filesystem/overlay/
|
|
82
|
+
- crates/kobako-runtime/src/filesystem/overlay/file.rs
|
|
83
|
+
- crates/kobako-runtime/src/filesystem/overlay/inode.rs
|
|
84
|
+
- crates/kobako-runtime/src/filesystem/overlay/path.rs
|
|
75
85
|
- crates/kobako-runtime/src/filesystem/overlay/stack.rs
|
|
76
|
-
- crates/kobako-runtime/src/filesystem/
|
|
77
|
-
- crates/kobako-runtime/src/filesystem/
|
|
86
|
+
- crates/kobako-runtime/src/filesystem/overlay/stack/copy_up.rs
|
|
87
|
+
- crates/kobako-runtime/src/filesystem/overlay/stack/dir.rs
|
|
88
|
+
- crates/kobako-runtime/src/filesystem/overlay/stack/namei.rs
|
|
89
|
+
- crates/kobako-runtime/src/filesystem/overlay/stack/readdir.rs
|
|
90
|
+
- crates/kobako-runtime/src/filesystem/pipe.rs
|
|
91
|
+
- crates/kobako-runtime/src/filesystem/rdir.rs
|
|
92
|
+
- crates/kobako-runtime/src/filesystem/tmpfs.rs
|
|
93
|
+
- crates/kobako-runtime/src/filesystem/tmpfs/seed.rs
|
|
94
|
+
- crates/kobako-runtime/src/filesystem/tmpfs/tmpfile.rs
|
|
95
|
+
- crates/kobako-runtime/src/filesystem/tmpfs/whiteout.rs
|
|
96
|
+
- crates/kobako-runtime/src/filesystem/tmpfs/xattr.rs
|
|
97
|
+
- crates/kobako-runtime/src/filesystem/wrap.rs
|
|
98
|
+
- crates/kobako-runtime/src/fork.rs
|
|
78
99
|
- crates/kobako-runtime/src/grant.rs
|
|
100
|
+
- crates/kobako-runtime/src/hashtable.rs
|
|
79
101
|
- crates/kobako-runtime/src/lib.rs
|
|
102
|
+
- crates/kobako-runtime/src/limits.rs
|
|
103
|
+
- crates/kobako-runtime/src/locking.rs
|
|
104
|
+
- crates/kobako-runtime/src/locking/seqlock.rs
|
|
105
|
+
- crates/kobako-runtime/src/memcg.rs
|
|
80
106
|
- crates/kobako-runtime/src/mount.rs
|
|
107
|
+
- crates/kobako-runtime/src/net.rs
|
|
108
|
+
- crates/kobako-runtime/src/net/backends.rs
|
|
109
|
+
- crates/kobako-runtime/src/net/connections.rs
|
|
110
|
+
- crates/kobako-runtime/src/net/credential.rs
|
|
111
|
+
- crates/kobako-runtime/src/net/egress.rs
|
|
112
|
+
- crates/kobako-runtime/src/net/family.rs
|
|
113
|
+
- crates/kobako-runtime/src/net/http.rs
|
|
114
|
+
- crates/kobako-runtime/src/net/lookup.rs
|
|
115
|
+
- crates/kobako-runtime/src/net/mock.rs
|
|
116
|
+
- crates/kobako-runtime/src/net/namespace.rs
|
|
117
|
+
- crates/kobako-runtime/src/net/reactor.rs
|
|
118
|
+
- crates/kobako-runtime/src/net/resolv.rs
|
|
119
|
+
- crates/kobako-runtime/src/net/resolv/darwin.rs
|
|
120
|
+
- crates/kobako-runtime/src/net/resolv/stub.rs
|
|
121
|
+
- crates/kobako-runtime/src/net/resolv/stub/tests.rs
|
|
122
|
+
- crates/kobako-runtime/src/net/resolv/windows.rs
|
|
123
|
+
- crates/kobako-runtime/src/net/socket.rs
|
|
124
|
+
- crates/kobako-runtime/src/net/tcp.rs
|
|
125
|
+
- crates/kobako-runtime/src/net/tls.rs
|
|
126
|
+
- crates/kobako-runtime/src/net/transport.rs
|
|
127
|
+
- crates/kobako-runtime/src/net/udp.rs
|
|
128
|
+
- crates/kobako-runtime/src/network.rs
|
|
129
|
+
- crates/kobako-runtime/src/network/builder.rs
|
|
130
|
+
- crates/kobako-runtime/src/network/ruleset.rs
|
|
131
|
+
- crates/kobako-runtime/src/policy.rs
|
|
81
132
|
- crates/kobako-runtime/src/profile.rs
|
|
82
133
|
- crates/kobako-runtime/src/runtime.rs
|
|
134
|
+
- crates/kobako-runtime/src/sched.rs
|
|
135
|
+
- crates/kobako-runtime/src/security.rs
|
|
136
|
+
- crates/kobako-runtime/src/security/entry_policy.rs
|
|
137
|
+
- crates/kobako-runtime/src/security/hooks.rs
|
|
138
|
+
- crates/kobako-runtime/src/security/mount_policy.rs
|
|
83
139
|
- crates/kobako-runtime/src/snapshot.rs
|
|
140
|
+
- crates/kobako-runtime/src/vfs.rs
|
|
141
|
+
- crates/kobako-runtime/src/vfs/attr.rs
|
|
142
|
+
- crates/kobako-runtime/src/vfs/dentry.rs
|
|
143
|
+
- crates/kobako-runtime/src/vfs/file.rs
|
|
144
|
+
- crates/kobako-runtime/src/vfs/inode.rs
|
|
145
|
+
- crates/kobako-runtime/src/vfs/kern_path.rs
|
|
146
|
+
- crates/kobako-runtime/src/vfs/mount.rs
|
|
147
|
+
- crates/kobako-runtime/src/vfs/namei.rs
|
|
148
|
+
- crates/kobako-runtime/src/vfs/namespace.rs
|
|
149
|
+
- crates/kobako-runtime/src/vfs/open_files.rs
|
|
150
|
+
- crates/kobako-runtime/src/vfs/openat2.rs
|
|
151
|
+
- crates/kobako-runtime/src/vfs/path.rs
|
|
152
|
+
- crates/kobako-runtime/src/vfs/readdir.rs
|
|
153
|
+
- crates/kobako-runtime/src/vfs/stat.rs
|
|
154
|
+
- crates/kobako-runtime/src/vfs/super_block.rs
|
|
155
|
+
- crates/kobako-runtime/src/vfs/utimes.rs
|
|
156
|
+
- crates/kobako-runtime/src/wait.rs
|
|
84
157
|
- crates/kobako-runtime/src/yielder.rs
|
|
85
158
|
- crates/kobako-transport/CHANGELOG.md
|
|
86
159
|
- crates/kobako-transport/Cargo.toml
|
|
@@ -92,6 +165,7 @@ files:
|
|
|
92
165
|
- crates/kobako-transport/src/envelope/compile_reply.rs
|
|
93
166
|
- crates/kobako-transport/src/envelope/error_record.rs
|
|
94
167
|
- crates/kobako-transport/src/envelope/fault.rs
|
|
168
|
+
- crates/kobako-transport/src/envelope/name.rs
|
|
95
169
|
- crates/kobako-transport/src/envelope/outcome.rs
|
|
96
170
|
- crates/kobako-transport/src/envelope/preamble.rs
|
|
97
171
|
- crates/kobako-transport/src/envelope/reply.rs
|
|
@@ -103,57 +177,72 @@ files:
|
|
|
103
177
|
- crates/kobako-wasmtime/CHANGELOG.md
|
|
104
178
|
- crates/kobako-wasmtime/Cargo.toml
|
|
105
179
|
- crates/kobako-wasmtime/README.md
|
|
180
|
+
- crates/kobako-wasmtime/build.rs
|
|
181
|
+
- crates/kobako-wasmtime/build/preview2.rs
|
|
106
182
|
- crates/kobako-wasmtime/src/abi.rs
|
|
107
183
|
- crates/kobako-wasmtime/src/ambient.rs
|
|
108
184
|
- crates/kobako-wasmtime/src/cache.rs
|
|
109
|
-
- crates/kobako-wasmtime/src/capture.rs
|
|
110
185
|
- crates/kobako-wasmtime/src/config.rs
|
|
111
|
-
- crates/kobako-wasmtime/src/descriptors.rs
|
|
112
|
-
- crates/kobako-wasmtime/src/dispatch.rs
|
|
113
186
|
- crates/kobako-wasmtime/src/driver.rs
|
|
114
187
|
- crates/kobako-wasmtime/src/exports.rs
|
|
115
|
-
- crates/kobako-wasmtime/src/
|
|
188
|
+
- crates/kobako-wasmtime/src/guest.rs
|
|
189
|
+
- crates/kobako-wasmtime/src/guest_binary.rs
|
|
116
190
|
- crates/kobako-wasmtime/src/imports.rs
|
|
117
191
|
- crates/kobako-wasmtime/src/instance_pre.rs
|
|
118
192
|
- crates/kobako-wasmtime/src/invocation.rs
|
|
119
|
-
- crates/kobako-wasmtime/src/io.rs
|
|
120
193
|
- crates/kobako-wasmtime/src/lib.rs
|
|
121
194
|
- crates/kobako-wasmtime/src/limiter.rs
|
|
122
195
|
- crates/kobako-wasmtime/src/preview1.rs
|
|
123
|
-
- crates/kobako-wasmtime/src/preview1/
|
|
124
|
-
- crates/kobako-wasmtime/src/preview1/beneath.rs
|
|
196
|
+
- crates/kobako-wasmtime/src/preview1/descriptors.rs
|
|
125
197
|
- crates/kobako-wasmtime/src/preview1/differential.rs
|
|
126
198
|
- crates/kobako-wasmtime/src/preview1/differential/mount.rs
|
|
127
199
|
- crates/kobako-wasmtime/src/preview1/errno.rs
|
|
128
200
|
- crates/kobako-wasmtime/src/preview1/fd.rs
|
|
129
201
|
- crates/kobako-wasmtime/src/preview1/memory.rs
|
|
130
202
|
- crates/kobako-wasmtime/src/preview1/mount_view.rs
|
|
203
|
+
- crates/kobako-wasmtime/src/preview1/mount_view/wrap.rs
|
|
131
204
|
- crates/kobako-wasmtime/src/preview1/path.rs
|
|
132
205
|
- crates/kobako-wasmtime/src/preview1/poll.rs
|
|
133
206
|
- crates/kobako-wasmtime/src/preview1/sock.rs
|
|
207
|
+
- crates/kobako-wasmtime/src/preview1/testsuite-expected.txt
|
|
208
|
+
- crates/kobako-wasmtime/src/preview1/testsuite.rs
|
|
209
|
+
- crates/kobako-wasmtime/src/preview2.rs
|
|
210
|
+
- crates/kobako-wasmtime/src/preview2/abi.rs
|
|
211
|
+
- crates/kobako-wasmtime/src/preview2/error.rs
|
|
212
|
+
- crates/kobako-wasmtime/src/preview2/filesystem.rs
|
|
213
|
+
- crates/kobako-wasmtime/src/preview2/host.rs
|
|
214
|
+
- crates/kobako-wasmtime/src/preview2/http.rs
|
|
215
|
+
- crates/kobako-wasmtime/src/preview2/io.rs
|
|
216
|
+
- crates/kobako-wasmtime/src/preview2/sockets.rs
|
|
217
|
+
- crates/kobako-wasmtime/src/preview2/table.rs
|
|
134
218
|
- crates/kobako-wasmtime/src/trap.rs
|
|
135
219
|
- crates/kobako-wasmtime/src/wasi.rs
|
|
136
|
-
- crates/kobako-wasmtime/
|
|
137
|
-
- crates/kobako-wasmtime/
|
|
138
|
-
- crates/kobako-wasmtime/
|
|
139
|
-
- crates/kobako-wasmtime/
|
|
140
|
-
- crates/kobako-wasmtime/
|
|
141
|
-
- crates/kobako-wasmtime/
|
|
142
|
-
- crates/kobako-wasmtime/
|
|
220
|
+
- crates/kobako-wasmtime/wit/deps/cli.wit
|
|
221
|
+
- crates/kobako-wasmtime/wit/deps/clocks.wit
|
|
222
|
+
- crates/kobako-wasmtime/wit/deps/filesystem.wit
|
|
223
|
+
- crates/kobako-wasmtime/wit/deps/http.wit
|
|
224
|
+
- crates/kobako-wasmtime/wit/deps/io.wit
|
|
225
|
+
- crates/kobako-wasmtime/wit/deps/random.wit
|
|
226
|
+
- crates/kobako-wasmtime/wit/deps/sockets.wit
|
|
227
|
+
- crates/kobako-wasmtime/witx/typenames.witx
|
|
228
|
+
- crates/kobako-wasmtime/witx/wasi_snapshot_preview1.witx
|
|
143
229
|
- data/kobako.wasm
|
|
144
230
|
- ext/kobako/Cargo.toml
|
|
145
231
|
- ext/kobako/extconf.rb
|
|
232
|
+
- ext/kobako/src/errors.rs
|
|
233
|
+
- ext/kobako/src/escape.rs
|
|
234
|
+
- ext/kobako/src/filesystem.rs
|
|
235
|
+
- ext/kobako/src/filesystem/grants.rs
|
|
236
|
+
- ext/kobako/src/filesystem/ruby.rs
|
|
237
|
+
- ext/kobako/src/gvl.rs
|
|
146
238
|
- ext/kobako/src/lib.rs
|
|
239
|
+
- ext/kobako/src/network.rs
|
|
240
|
+
- ext/kobako/src/network/mock.rs
|
|
241
|
+
- ext/kobako/src/pinned_value.rs
|
|
147
242
|
- ext/kobako/src/runtime.rs
|
|
148
243
|
- ext/kobako/src/runtime/bridge.rs
|
|
149
|
-
- ext/kobako/src/runtime/errors.rs
|
|
150
|
-
- ext/kobako/src/runtime/escape.rs
|
|
151
|
-
- ext/kobako/src/runtime/filesystem.rs
|
|
152
|
-
- ext/kobako/src/runtime/filesystem/grants.rs
|
|
153
|
-
- ext/kobako/src/runtime/filesystem/ruby.rs
|
|
154
|
-
- ext/kobako/src/runtime/gvl.rs
|
|
155
|
-
- ext/kobako/src/runtime/pinned_value.rs
|
|
156
244
|
- ext/kobako/src/runtime/snapshot.rs
|
|
245
|
+
- ext/kobako/src/wire.rs
|
|
157
246
|
- lib/kobako.rb
|
|
158
247
|
- lib/kobako/capture.rb
|
|
159
248
|
- lib/kobako/catalog.rb
|
|
@@ -162,9 +251,12 @@ files:
|
|
|
162
251
|
- lib/kobako/catalog/grants.rb
|
|
163
252
|
- lib/kobako/catalog/handles.rb
|
|
164
253
|
- lib/kobako/catalog/mount.rb
|
|
254
|
+
- lib/kobako/catalog/network.rb
|
|
255
|
+
- lib/kobako/catalog/replacements.rb
|
|
165
256
|
- lib/kobako/catalog/services.rb
|
|
166
257
|
- lib/kobako/catalog/snippets.rb
|
|
167
258
|
- lib/kobako/codec.rb
|
|
259
|
+
- lib/kobako/codec/boundary.rb
|
|
168
260
|
- lib/kobako/codec/decoder.rb
|
|
169
261
|
- lib/kobako/codec/encoder.rb
|
|
170
262
|
- lib/kobako/codec/error.rb
|
|
@@ -172,15 +264,15 @@ files:
|
|
|
172
264
|
- lib/kobako/codec/handle_walk.rb
|
|
173
265
|
- lib/kobako/codec/nesting.rb
|
|
174
266
|
- lib/kobako/codec/state.rb
|
|
175
|
-
- lib/kobako/codec/utils.rb
|
|
176
267
|
- lib/kobako/codec/value_budget.rb
|
|
177
|
-
- lib/kobako/constant_name.rb
|
|
178
268
|
- lib/kobako/context.rb
|
|
179
269
|
- lib/kobako/errors.rb
|
|
180
270
|
- lib/kobako/execution.rb
|
|
181
271
|
- lib/kobako/extension.rb
|
|
182
272
|
- lib/kobako/filesystem.rb
|
|
183
273
|
- lib/kobako/handle.rb
|
|
274
|
+
- lib/kobako/names.rb
|
|
275
|
+
- lib/kobako/network.rb
|
|
184
276
|
- lib/kobako/outcome.rb
|
|
185
277
|
- lib/kobako/payload.rb
|
|
186
278
|
- lib/kobako/payload/arguments.rb
|
|
@@ -192,6 +284,7 @@ files:
|
|
|
192
284
|
- lib/kobako/snippet/bytecode.rb
|
|
193
285
|
- lib/kobako/snippet/source.rb
|
|
194
286
|
- lib/kobako/transport.rb
|
|
287
|
+
- lib/kobako/transport/argument_wrap.rb
|
|
195
288
|
- lib/kobako/transport/block_failure.rb
|
|
196
289
|
- lib/kobako/transport/call.rb
|
|
197
290
|
- lib/kobako/transport/dispatcher.rb
|
|
@@ -204,6 +297,7 @@ files:
|
|
|
204
297
|
- lib/kobako/usage.rb
|
|
205
298
|
- lib/kobako/version.rb
|
|
206
299
|
- release-please-config.json
|
|
300
|
+
- sig/core/thread.rbs
|
|
207
301
|
- sig/kobako.rbs
|
|
208
302
|
- sig/kobako/capture.rbs
|
|
209
303
|
- sig/kobako/catalog.rbs
|
|
@@ -212,9 +306,12 @@ files:
|
|
|
212
306
|
- sig/kobako/catalog/grants.rbs
|
|
213
307
|
- sig/kobako/catalog/handles.rbs
|
|
214
308
|
- sig/kobako/catalog/mount.rbs
|
|
309
|
+
- sig/kobako/catalog/network.rbs
|
|
310
|
+
- sig/kobako/catalog/replacements.rbs
|
|
215
311
|
- sig/kobako/catalog/services.rbs
|
|
216
312
|
- sig/kobako/catalog/snippets.rbs
|
|
217
313
|
- sig/kobako/codec.rbs
|
|
314
|
+
- sig/kobako/codec/boundary.rbs
|
|
218
315
|
- sig/kobako/codec/decoder.rbs
|
|
219
316
|
- sig/kobako/codec/encoder.rbs
|
|
220
317
|
- sig/kobako/codec/error.rbs
|
|
@@ -222,9 +319,7 @@ files:
|
|
|
222
319
|
- sig/kobako/codec/handle_walk.rbs
|
|
223
320
|
- sig/kobako/codec/nesting.rbs
|
|
224
321
|
- sig/kobako/codec/state.rbs
|
|
225
|
-
- sig/kobako/codec/utils.rbs
|
|
226
322
|
- sig/kobako/codec/value_budget.rbs
|
|
227
|
-
- sig/kobako/constant_name.rbs
|
|
228
323
|
- sig/kobako/context.rbs
|
|
229
324
|
- sig/kobako/errors.rbs
|
|
230
325
|
- sig/kobako/execution.rbs
|
|
@@ -232,6 +327,7 @@ files:
|
|
|
232
327
|
- sig/kobako/filesystem.rbs
|
|
233
328
|
- sig/kobako/guest_yielder.rbs
|
|
234
329
|
- sig/kobako/handle.rbs
|
|
330
|
+
- sig/kobako/network.rbs
|
|
235
331
|
- sig/kobako/outcome.rbs
|
|
236
332
|
- sig/kobako/payload.rbs
|
|
237
333
|
- sig/kobako/payload/arguments.rbs
|
|
@@ -244,6 +340,7 @@ files:
|
|
|
244
340
|
- sig/kobako/snippet/bytecode.rbs
|
|
245
341
|
- sig/kobako/snippet/source.rbs
|
|
246
342
|
- sig/kobako/transport.rbs
|
|
343
|
+
- sig/kobako/transport/argument_wrap.rbs
|
|
247
344
|
- sig/kobako/transport/block_failure.rbs
|
|
248
345
|
- sig/kobako/transport/call.rbs
|
|
249
346
|
- sig/kobako/transport/dispatcher.rbs
|
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
//! How a host directory spells a name it holds. A host that folds case or
|
|
2
|
-
//! Unicode form reaches one entry by many names, so a Policy judging the
|
|
3
|
-
//! name as asked would see a spelling the host never stored.
|
|
4
|
-
//!
|
|
5
|
-
//! macOS answers the stored name for any spelling. Elsewhere a listing
|
|
6
|
-
//! finds the entry by its inode, skipped on a Linux filesystem known to
|
|
7
|
-
//! match names exactly; without an inode, a spelling the listing lacks is
|
|
8
|
-
//! refused.
|
|
9
|
-
|
|
10
|
-
use std::io;
|
|
11
|
-
|
|
12
|
-
use cap_std::fs::Dir;
|
|
13
|
-
|
|
14
|
-
/// The name `parent` stores for the entry `name` reaches, a link reached
|
|
15
|
-
/// as itself, or `None` when nothing is there.
|
|
16
|
-
pub(super) fn stored_name(parent: &Dir, name: &str) -> io::Result<Option<String>> {
|
|
17
|
-
#[cfg(target_os = "macos")]
|
|
18
|
-
{
|
|
19
|
-
macos::stored_name(parent, name)
|
|
20
|
-
}
|
|
21
|
-
#[cfg(not(target_os = "macos"))]
|
|
22
|
-
{
|
|
23
|
-
#[cfg(target_os = "linux")]
|
|
24
|
-
if linux::matches_exactly(parent) {
|
|
25
|
-
return match parent.symlink_metadata(name) {
|
|
26
|
-
Ok(_) => Ok(Some(name.to_string())),
|
|
27
|
-
Err(err) if err.kind() == io::ErrorKind::NotFound => Ok(None),
|
|
28
|
-
Err(err) => Err(err),
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
stored_name_by_listing(parent, name)
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/// The name a listing of `parent` holds for `name`: itself when listed,
|
|
36
|
-
/// else the entry sharing its inode.
|
|
37
|
-
#[cfg(not(target_os = "macos"))]
|
|
38
|
-
fn stored_name_by_listing(parent: &Dir, name: &str) -> io::Result<Option<String>> {
|
|
39
|
-
let found = match parent.symlink_metadata(name) {
|
|
40
|
-
Ok(found) => found,
|
|
41
|
-
Err(err) if err.kind() == io::ErrorKind::NotFound => return Ok(None),
|
|
42
|
-
Err(err) => return Err(err),
|
|
43
|
-
};
|
|
44
|
-
let mut names = Vec::new();
|
|
45
|
-
for entry in parent.entries()? {
|
|
46
|
-
let entry = entry?;
|
|
47
|
-
if entry.file_name() == name {
|
|
48
|
-
return Ok(Some(name.to_string()));
|
|
49
|
-
}
|
|
50
|
-
names.push(entry);
|
|
51
|
-
}
|
|
52
|
-
#[cfg(unix)]
|
|
53
|
-
{
|
|
54
|
-
use cap_std::fs::MetadataExt;
|
|
55
|
-
use std::os::unix::fs::DirEntryExt;
|
|
56
|
-
for entry in names {
|
|
57
|
-
if entry.ino() == found.ino() {
|
|
58
|
-
return entry
|
|
59
|
-
.file_name()
|
|
60
|
-
.into_string()
|
|
61
|
-
.map(Some)
|
|
62
|
-
.map_err(|_| io::ErrorKind::InvalidData.into());
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
#[cfg(not(unix))]
|
|
67
|
-
let _ = (found, names);
|
|
68
|
-
Err(io::ErrorKind::PermissionDenied.into())
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
#[cfg(target_os = "macos")]
|
|
72
|
-
mod macos {
|
|
73
|
-
use std::ffi::CString;
|
|
74
|
-
use std::io;
|
|
75
|
-
use std::os::fd::AsRawFd;
|
|
76
|
-
|
|
77
|
-
use cap_std::fs::Dir;
|
|
78
|
-
|
|
79
|
-
/// The reply `getattrlist(2)` writes for `ATTR_CMN_NAME`: its length,
|
|
80
|
-
/// then a reference to the name stored behind it.
|
|
81
|
-
#[repr(C, packed(4))]
|
|
82
|
-
struct NameReply {
|
|
83
|
-
length: u32,
|
|
84
|
-
name: libc::attrreference_t,
|
|
85
|
-
data: [u8; 1024],
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
pub(super) fn stored_name(parent: &Dir, name: &str) -> io::Result<Option<String>> {
|
|
89
|
-
let path = CString::new(name).map_err(|_| io::Error::from(io::ErrorKind::InvalidInput))?;
|
|
90
|
-
let mut request = libc::attrlist {
|
|
91
|
-
bitmapcount: libc::ATTR_BIT_MAP_COUNT,
|
|
92
|
-
reserved: 0,
|
|
93
|
-
commonattr: libc::ATTR_CMN_NAME,
|
|
94
|
-
volattr: 0,
|
|
95
|
-
dirattr: 0,
|
|
96
|
-
fileattr: 0,
|
|
97
|
-
forkattr: 0,
|
|
98
|
-
};
|
|
99
|
-
let mut reply = NameReply {
|
|
100
|
-
length: 0,
|
|
101
|
-
name: libc::attrreference_t {
|
|
102
|
-
attr_dataoffset: 0,
|
|
103
|
-
attr_length: 0,
|
|
104
|
-
},
|
|
105
|
-
data: [0; 1024],
|
|
106
|
-
};
|
|
107
|
-
// SAFETY: every pointer names a live, correctly sized buffer, and
|
|
108
|
-
// the reply buffer's size bounds what the call writes.
|
|
109
|
-
let answered = unsafe {
|
|
110
|
-
libc::getattrlistat(
|
|
111
|
-
parent.as_raw_fd(),
|
|
112
|
-
path.as_ptr(),
|
|
113
|
-
(&raw mut request).cast(),
|
|
114
|
-
(&raw mut reply).cast(),
|
|
115
|
-
size_of::<NameReply>(),
|
|
116
|
-
libc::FSOPT_NOFOLLOW as libc::c_ulong,
|
|
117
|
-
)
|
|
118
|
-
};
|
|
119
|
-
if answered != 0 {
|
|
120
|
-
let err = io::Error::last_os_error();
|
|
121
|
-
return match err.kind() {
|
|
122
|
-
io::ErrorKind::NotFound => Ok(None),
|
|
123
|
-
_ => Err(err),
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
// The reference counts from itself, and `data` follows it; the
|
|
127
|
-
// length counts the terminating NUL.
|
|
128
|
-
let start = usize::try_from(reply.name.attr_dataoffset)
|
|
129
|
-
.ok()
|
|
130
|
-
.and_then(|offset| offset.checked_sub(size_of::<libc::attrreference_t>()));
|
|
131
|
-
let len = (reply.name.attr_length as usize).checked_sub(1);
|
|
132
|
-
let stored = start
|
|
133
|
-
.zip(len)
|
|
134
|
-
.and_then(|(start, len)| reply.data.get(start..start.checked_add(len)?))
|
|
135
|
-
.ok_or(io::ErrorKind::InvalidData)?;
|
|
136
|
-
String::from_utf8(stored.to_vec())
|
|
137
|
-
.map(Some)
|
|
138
|
-
.map_err(|_| io::ErrorKind::InvalidData.into())
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
#[cfg(target_os = "linux")]
|
|
143
|
-
mod linux {
|
|
144
|
-
use cap_std::fs::Dir;
|
|
145
|
-
use rustix::fs::{fstatfs, ioctl_getflags};
|
|
146
|
-
|
|
147
|
-
/// The 32-bit magic numbers of filesystems matching names byte for
|
|
148
|
-
/// byte unless a directory is marked to fold case: ext4, Btrfs, tmpfs,
|
|
149
|
-
/// overlayfs, and F2FS. XFS is left to the listing, as a volume made
|
|
150
|
-
/// ASCII case-insensitive marks no directory.
|
|
151
|
-
const EXACT: [u32; 5] = [0xEF53, 0x9123_683E, 0x0102_1994, 0x794C_7630, 0xF2F5_2010];
|
|
152
|
-
|
|
153
|
-
/// The inode flag marking a directory whose names fold case, from
|
|
154
|
-
/// Linux's `FS_CASEFOLD_FL`.
|
|
155
|
-
const CASEFOLD: u32 = 0x4000_0000;
|
|
156
|
-
|
|
157
|
-
pub(super) fn matches_exactly(parent: &Dir) -> bool {
|
|
158
|
-
let exact = fstatfs(parent).is_ok_and(|stats| EXACT.contains(&(stats.f_type as u32)));
|
|
159
|
-
exact && ioctl_getflags(parent).is_ok_and(|flags| flags.bits() & CASEFOLD == 0)
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
#[cfg(test)]
|
|
163
|
-
mod tests {
|
|
164
|
-
use cap_std::ambient_authority;
|
|
165
|
-
|
|
166
|
-
use super::super::stored_name_by_listing;
|
|
167
|
-
use super::Dir;
|
|
168
|
-
|
|
169
|
-
// A Linux host whose filesystem is not known to match exactly,
|
|
170
|
-
// XFS among them, spells by listing; the host here matches
|
|
171
|
-
// exactly, so the listing must answer as the lookup would.
|
|
172
|
-
// @behavior FS-081
|
|
173
|
-
#[test]
|
|
174
|
-
fn a_listing_spells_names_it_matches_exactly_as_given() {
|
|
175
|
-
let path = std::env::temp_dir().join(format!("kobako-listed-{}", std::process::id()));
|
|
176
|
-
let _ = std::fs::remove_dir_all(&path);
|
|
177
|
-
std::fs::create_dir_all(&path).expect("the host directory must be created");
|
|
178
|
-
std::fs::write(path.join("file"), "x").expect("the host file must be written");
|
|
179
|
-
let dir = Dir::open_ambient_dir(&path, ambient_authority())
|
|
180
|
-
.expect("the host directory must open");
|
|
181
|
-
let answers = (
|
|
182
|
-
stored_name_by_listing(&dir, "file").ok(),
|
|
183
|
-
stored_name_by_listing(&dir, "missing").ok(),
|
|
184
|
-
);
|
|
185
|
-
let _ = std::fs::remove_dir_all(&path);
|
|
186
|
-
assert_eq!(
|
|
187
|
-
answers,
|
|
188
|
-
(Some(Some("file".to_string())), Some(None)),
|
|
189
|
-
"a name the host holds, spelled by listing its directory, must come back as \
|
|
190
|
-
given, and a name it lacks as none"
|
|
191
|
-
);
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
}
|