1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
|
#!/usr/bin/env python3
"""Give the GitHub Action's relay its own user, limited to the addresses that model requests go to.
Usage:
scan_user.py host PROVIDER URL
scan_user.py rules HOST:PORT FOLDER
scan_user.py start FOLDER -- COMMAND...
scan_user.py session FOLDER -- ARGUMENTS...
scan_user.py view FOLDER VARIABLES -- COMMAND...
scan_user.py alone FOLDER VARIABLES -- COMMAND...
scan_user.py end REPORTS OUTCOME
scan_user.py check HOST:PORT
scan_user.py sweep
The user claude-security-scan already exists.
host Prints the `host:port` that model requests go to: the one that URL names or, if URL
is empty, PROVIDER's own.
rules Looks up the host's IPv4 addresses once. Writes into FOLDER `hosts`, a copy of /etc/hosts
that also maps the host to them, and `iptables` and `ip6tables`, for iptables-restore and
ip6tables-restore with --noflush.
start Execs COMMAND as the user, through sudo and `view`. COMMAND gets $PATH and $HOME, and
those of the caller's other variables that handed_on() picks.
session Execs sandbox.py as root, through sudo and `alone`, with the lines of the file
claude-security-sandbox-arguments beside FOLDER, then ARGUMENTS. It gets the same
variables and those that name sign-in files, which it hides, and goes on as the user once
its keeper runs. Of the same variables, the command inside gets those that relay_alone()
does not keep back, those that the action's input names, and what sandbox.py itself
passes: the names of models, regions and the Vertex project.
view Run as root in its own mount namespace, lays FOLDER's `hosts` over /etc/hosts. Then it
execs COMMAND with the variables in the file VARIABLES, which it removes.
alone As `view`, but it lays an empty tmpfs over /run, COMMAND runs as process 1 of a PID
namespace of its own, and this verb stays. It turns INT, TERM and HUP into a TERM for
COMMAND, and exits as COMMAND does.
end Waits for the last process of the user and of the sandbox's user ids to end, or kills
what is left and fails. Once a look finds nothing, it kills as each of those ids what
the look missed, and looks again. It fails if that kill fails, or if a file below
REPORTS has a second name. Otherwise it makes the caller the owner of REPORTS, and
closes that folder to other users.
OUTCOME is that of the scan's step. Where it is `cancelled`, this verb kills what is
left at once, and again until a kill passes and nothing is left, fails if that has not
happened after at least a minute, and leaves REPORTS as it is.
check Run as the user, connects to the host and finds what else the firewall does not
refuse.
sweep Run as root, kills every process of the user and of the sandbox's user ids with one
signal for each id, which no fork can outrun, and fails if a kill fails.
Needs Linux and sudo without a password. Exits 0, or as what it execs does; 1, with the reason on
standard error. Python 3.9, stdlib only.
"""
from __future__ import annotations
import errno
import ipaddress
import os
import re
import shlex
import signal
import socket
import subprocess
import sys
import tempfile
import time
from contextlib import suppress
from dataclasses import dataclass
from pathlib import Path
from typing import TYPE_CHECKING, Final, NoReturn, final
# Under -I, -P or PYTHONSAFEPATH Python leaves this script's folder, with lib/, off the import path.
sys.path.insert(0, str(Path(__file__).resolve().parent))
from lib.sandbox.plan import FREE_IDS
from lib.sandbox.provider import CREDENTIAL_FILES
from lib.sandbox_hosts import HostError, Provider, allowed
if TYPE_CHECKING:
from collections.abc import Callable, Collection, Iterable, Iterator, Mapping, Sequence
@final
class Scan:
"""The user, whose group and chain share its name, and the values the verbs use."""
USER = "claude-security-scan"
ARGUMENTS = "claude-security-sandbox-arguments"
OWNERS = ",".join((USER, *map(str, FREE_IDS)))
NAMED_BY = (
"The name comes from model_base_url or, if that is empty, from the job's provider settings."
)
PRIVATELY = "Please report this privately, as this action's SECURITY.md describes."
POLLS = 600
POLL_S = 0.1
CANCELLED = "cancelled"
TEST_NET = "192.0.2.1"
AZURE_PLATFORM = "168.63.129.16"
RESOLVER = "127.0.0.53"
DNS_PORT = 53
HOSTS = "hosts"
TIMEOUT_S = 10
VARIABLES_FILE_PREFIX = "claude-security-variables-"
SET_ELSEWHERE = frozenset({"PATH", "HOME", "USER", "LOGNAME"})
HANDED_ON = frozenset({
"CI",
"CLOUD_ML_REGION",
"GITHUB_ACTIONS",
"GITHUB_WORKSPACE",
"GIT_CONFIG_COUNT",
"GIT_CONFIG_KEY_0",
"GIT_CONFIG_KEY_1",
"GIT_CONFIG_KEY_2",
"GIT_CONFIG_NOSYSTEM",
"GIT_CONFIG_VALUE_0",
"GIT_CONFIG_VALUE_1",
"GIT_CONFIG_VALUE_2",
"GIT_NO_LAZY_FETCH",
"GIT_TERMINAL_PROMPT",
"LANG",
"NODE_EXTRA_CA_CERTS",
"TZ",
})
PREFIXES = ("ANTHROPIC_", "CLAUDE_", "LC_")
BEDROCK = "CLAUDE_CODE_USE_BEDROCK"
FOR_BEDROCK = frozenset({
"AWS_ACCESS_KEY_ID",
"AWS_BEARER_TOKEN_BEDROCK",
"AWS_REGION",
"AWS_SECRET_ACCESS_KEY",
"AWS_SESSION_TOKEN",
})
INPUT = "scan_variables"
MORE = "CLAUDE_SECURITY_SCAN_VARIABLES"
# These hold or mint the job's tokens. scripts/sandbox/sandboxed-claude.sh unsets them too.
TOKENS = frozenset({
"GITHUB_TOKEN",
"GH_TOKEN",
"OVERRIDE_GITHUB_TOKEN",
"DEFAULT_WORKFLOW_TOKEN",
"ALL_INPUTS",
"ACTIONS_RUNTIME_TOKEN",
"ACTIONS_ID_TOKEN_REQUEST_TOKEN",
"ACTIONS_ID_TOKEN_REQUEST_URL",
})
RELAY_ALONE = (
"ANTHROPIC_",
"AWS_",
"CLAUDE_CODE_CLIENT_",
"NODE_EXTRA_CA_CERTS",
)
SECRET = re.compile(r"TOKEN(?!S)|SECRET|KEY|PASS|CREDENTIAL", re.IGNORECASE)
class ScanUserError(Exception):
"""Why the work was not done, in words for whoever reads the job's log."""
@dataclass(frozen=True)
class Launch:
"""The words to put before a command, and the variables that the whole line starts under."""
before: tuple[str, ...]
variables: Mapping[str, str]
def host(provider: str, url: str) -> None:
print(allowed(Provider(provider), os.environ, url))
def address(target: str) -> tuple[str, int]:
"""The host and the port of `target`, as `host` prints it."""
name, _, port = target.rpartition(":")
return name, int(port)
def chain(accepted: Iterable[str]) -> str:
"""What iptables-restore or ip6tables-restore reads: the user's chain, the jump to it, and the
rejection of the sandbox's ids."""
user = Scan.USER
return "\n".join((
"*filter",
f":{user} - [0:0]",
*accepted,
f"-A {user} -j REJECT",
# Inserted first, so that no one else's ACCEPT comes before them.
f"-I OUTPUT 1 -m owner --uid-owner {user} -j {user}",
f"-I OUTPUT 1 -m owner --uid-owner {FREE_IDS[0]}-{FREE_IDS[-1]} -j REJECT",
"COMMIT",
"",
))
def rules(target: str, folder: str) -> None:
name, port = address(target)
try:
found = socket.getaddrinfo(name, port, socket.AF_INET, socket.SOCK_STREAM)
except socket.gaierror as error:
msg = (
f"This runner found no IPv4 address for {name}, the host that model requests go to "
f"({error.strerror}). Nothing was scanned. {Scan.NAMED_BY} Check that the name is "
"right and that this runner can look it up. Then run the job again."
)
raise ScanUserError(msg) from error
addresses = sorted({str(place[0]) for *_, place in found})
parsed = map(ipaddress.IPv4Address, addresses)
if bad := ", ".join(
str(a)
for a in parsed
if a.is_link_local or a.is_loopback or a.is_unspecified or str(a) == Scan.AZURE_PLATFORM
):
msg = (
f"{name}, the host that model requests go to, resolves to {bad}. The action does not "
"support a model host at a loopback or link-local (169.254.0.0/16) address, at "
f"0.0.0.0, or at {Scan.AZURE_PLATFORM} (Azure's platform services). Nothing was "
f"scanned. {Scan.NAMED_BY}"
)
raise ScanUserError(msg)
hosts = Path("/etc/hosts").read_text(encoding="utf-8").rstrip("\n")
for file, text in {
Scan.HOSTS: "\n".join((hosts, *(f"{one} {name}" for one in addresses), "")),
"iptables": chain(
f"-A {Scan.USER} -d {one} -p tcp --dport {port} -j ACCEPT" for one in addresses
),
"ip6tables": chain(()),
}.items():
(Path(folder) / file).write_text(text, encoding="utf-8")
# The user reads it as its /etc/hosts, whatever the job's umask.
(Path(folder) / Scan.HOSTS).chmod(0o644)
def run(*words: str | Path, fine: Collection[int] = (0,)) -> subprocess.CompletedProcess[bytes]:
"""Run a program, which must end with a status in `fine`. Returns what it did."""
ran = subprocess.run(words, check=False, capture_output=True)
if ran.returncode not in fine:
# !a keeps what the program said on one line, whatever a file's name holds.
err = ran.stderr.decode("utf-8", "surrogateescape").strip()
why = f" and said {err!a}" if err else ""
msg = f"`{shlex.join(map(str, words))}` failed with status {ran.returncode}{why}"
raise ScanUserError(msg)
return ran
def left_running() -> bool:
"""Whether the user or one of the sandbox's ids has a process. Raises ScanUserError if that
cannot be found out."""
return not run("pgrep", "-u", Scan.OWNERS, fine=(0, 1)).returncode
def give_back(reports: str) -> None:
"""Make the caller the owner of what is below `reports`, and close that folder to other users.
Raises ScanUserError if a file there has a second name."""
linked = run(
"sudo", "-n", "find", reports, "!", "-type", "d", "-links", "+1", "-print", "-quit"
)
if linked.stdout:
name = linked.stdout.decode("utf-8", "surrogateescape").rstrip("\n")
msg = (
f"{name!a} has a second name (a hard link), so the report was not given back to the "
f"job's user. {Scan.PRIVATELY}"
)
raise ScanUserError(msg)
run("sudo", "-n", "chown", "-R", "-h", f"{os.getuid()}:{os.getgid()}", "--", reports)
# The user could change this folder's mode while the folder was its own.
Path(reports).chmod(0o700)
def sweep() -> None:
"""Kill each process of the user and of the sandbox's ids with one signal for each id, which
no fork can outrun. Raises ScanUserError if that fails."""
run("sudo", "-n", "/usr/bin/python3", "-I", "-S", str(Path(__file__).resolve()), "sweep")
def sweep_as_root() -> None:
"""Run as root: for each of the user and the sandbox's ids, a child takes that id and sends
SIGKILL to -1, which reaches every process of the id but the child itself. Raises ScanUserError
if a child fails."""
import pwd
failed: list[str] = []
for uid in (pwd.getpwnam(Scan.USER).pw_uid, *FREE_IDS):
if uid == 0:
msg = "User id 0 is root's, whose processes the sweep does not kill."
raise ScanUserError(msg)
child = os.fork()
if not child:
try:
os.setresuid(uid, uid, uid)
with suppress(ProcessLookupError):
os.kill(-1, signal.SIGKILL)
except BaseException:
os._exit(1)
os._exit(0)
_, status = os.waitpid(child, os.WUNTRACED)
if os.WIFSTOPPED(status):
os.kill(child, signal.SIGKILL)
os.waitpid(child, 0)
if status:
failed.append(str(uid))
if failed:
msg = f"The kill of the processes of user ids {', '.join(failed)} failed."
raise ScanUserError(msg)
def kill_until_none_is_left() -> None:
"""Kill each process of the user and of the sandbox's ids, again until a kill passes and none is
left. Raises ScanUserError if that has not happened after at least a minute, or a look cannot
find out."""
failed = None
for _ in range(Scan.POLLS):
try:
sweep()
failed = None
except ScanUserError as error:
failed = error
if failed is None and not left_running():
return
time.sleep(Scan.POLL_S)
msg = (
f"A process of the scan's user ({Scan.USER}) or of the sandbox may still run after at "
f"least {Scan.POLLS * Scan.POLL_S:.0f} seconds of tries to kill what the cancelled scan "
"left."
)
if failed:
msg += f" The last try: {failed}."
raise ScanUserError(msg) from failed
def end(reports: str, scan_outcome: str) -> None:
if scan_outcome == Scan.CANCELLED:
kill_until_none_is_left()
return
for _ in range(Scan.POLLS):
if not left_running():
sweep()
if not left_running():
give_back(reports)
return
time.sleep(Scan.POLL_S)
sweep()
msg = (
f"A process of the scan's user ({Scan.USER}) or of the sandbox was still running "
f"{Scan.POLLS * Scan.POLL_S:.0f} seconds after the scan's step ended, so it was killed. "
"The report may not be whole, and it was not given back to the job's user."
)
raise ScanUserError(msg)
def not_for_the_input(name: str) -> bool:
"""Whether the input may not name the variable `name`: it holds or mints one of the job's
tokens, or the launch or sudo sets it."""
return name in Scan.TOKENS | Scan.SET_ELSEWHERE or name.startswith("SUDO_")
def named_by_the_input() -> list[str]:
return os.environ.get(Scan.MORE, "").split()
def handed_on() -> dict[str, str]:
"""The caller's variables that both launches write to the file of variables, beside PATH and
HOME: those that Scan.HANDED_ON, Scan.PREFIXES and, on Amazon Bedrock, Scan.FOR_BEDROCK name,
and those that $CLAUDE_SECURITY_SCAN_VARIABLES names. Raises ScanUserError for a name that the
input may not give."""
more = named_by_the_input()
if refused := list(filter(not_for_the_input, more)):
msg = (
f"The input {Scan.INPUT} names {', '.join(map(repr, refused))}, which the scan cannot "
"get. Name no variable that holds or mints the job's token, or that the action or sudo "
"sets itself. Nothing was scanned."
)
raise ScanUserError(msg)
for_bedrock = Scan.FOR_BEDROCK if os.environ.get(Scan.BEDROCK) == "1" else ()
listed = {*Scan.HANDED_ON, *for_bedrock, *more}
# Not the input's own text: it may hold a value that a team put there by mistake.
return {
name: value
for name, value in os.environ.items()
if name != Scan.MORE and (name in listed or name.startswith(Scan.PREFIXES))
}
def write_variables(given: Mapping[str, str]) -> Path:
"""Write `given` to a new file of variables, in RUNNER_TEMP, that only the caller can open.
Returns its path."""
temp = os.environ["RUNNER_TEMP"]
descriptor, variables = tempfile.mkstemp(prefix=Scan.VARIABLES_FILE_PREFIX, dir=temp)
with os.fdopen(descriptor, "wb") as file:
file.write(b"\0".join(os.fsencode(f"{name}={value}") for name, value in given.items()))
return Path(variables)
def take_variables(variables: Path) -> dict[str, str]:
"""The variables in the file `variables`, which it removes."""
parts = os.fsdecode(variables.read_bytes()).split("\0")
variables.unlink()
return dict(part.split("=", 1) for part in parts)
def launch(verb: str, folder: str, handed: Mapping[str, str], *program: str) -> Launch:
"""The words that, put before what `program` takes, run it as root under `verb`, to start under
PATH alone. `program` starts with a full path, because root must run nothing that the job's PATH
finds. Writes `handed`, with PATH and HOME, to the file of variables that the words name."""
path = os.environ["PATH"]
variables = write_variables({**handed, "PATH": path, "HOME": os.environ["HOME"]})
words = (
*("sudo", "-n", "unshare", "--mount", "--propagation", "private", "--ipc"),
*("python3", "-I", "-S", str(Path(__file__).resolve()), verb),
*(folder, str(variables), "--", *program),
)
return Launch(words, {"PATH": path})
def start(folder: str) -> Launch:
"""The words that, put before a command, run it as the user."""
user = Scan.USER
drop = ("--reuid", user, "--regid", user, "--clear-groups", "--no-new-privs", "--")
return launch("view", folder, handed_on(), "/usr/bin/setpriv", *drop)
def relay_alone(name: str) -> bool:
"""Whether --env leaves the variable `name` out, unless the input names it."""
by_prefix = name.startswith(Scan.PREFIXES) and Scan.SECRET.search(name)
return name.startswith(Scan.RELAY_ALONE) or bool(by_prefix)
def session(folder: str) -> Launch:
"""The words that, put before ARGUMENTS, run sandbox.py as root, to go on as the user."""
sandbox = str(Path(__file__).resolve().with_name("sandbox.py"))
given = (Path(folder).parent / Scan.ARGUMENTS).read_text(encoding="utf-8").splitlines()
named, handed = named_by_the_input(), handed_on()
passed = (f"--env={name}" for name in handed if name in named or not relay_alone(name))
files = {name: os.environ[name] for name in CREDENTIAL_FILES if name in os.environ}
python = ("/usr/bin/python3", "-I", "-S")
return launch(
"alone", folder, {**handed, **files}, *python, sandbox, "--user", Scan.USER, *passed, *given
)
def view(folder: str, variables: str) -> Launch:
"""Take the file of variables and pin the host. Returns what COMMAND starts under: root's own
variables, and over them the file's."""
given = take_variables(Path(variables))
run("mount", "--bind", Path(folder) / Scan.HOSTS, "/etc/hosts")
return Launch((), {**os.environ, **given})
def ended_otherwise(kind: socket.SocketKind, place: str, port: int) -> str | None:
"""How a try at `place` ended, in words. None if it was refused as by a REJECT, or `place`
is IPv6 and this machine has no IPv6 at all, or has it switched off."""
family, level, hops = (
(socket.AF_INET6, socket.IPPROTO_IPV6, socket.IPV6_UNICAST_HOPS)
if ":" in place
else (socket.AF_INET, socket.IPPROTO_IP, socket.IP_TTL)
)
refusals = (
errno.ECONNREFUSED if kind is socket.SOCK_STREAM else errno.EPERM,
*((errno.EAFNOSUPPORT, errno.EADDRNOTAVAIL) if family is socket.AF_INET6 else ()),
)
try:
with socket.socket(family, kind) as sock:
sock.settimeout(Scan.TIMEOUT_S)
sock.setsockopt(level, hops, 1)
sock.connect((place, port))
sock.send(b"\0")
except OSError as error:
if error.errno in refusals:
return None
return f"the try ended otherwise: {error.strerror or error}"
return "it succeeded"
def reaches(place: str, port: int) -> Iterator[str]:
"""The tries, other than TCP to `place` at `port`, that are not refused, each in a clause."""
for kind, where, at in (
(socket.SOCK_STREAM, Scan.TEST_NET, port),
(socket.SOCK_STREAM, place, 443 if port == 80 else 80),
(socket.SOCK_DGRAM, place, port),
(socket.SOCK_DGRAM, Scan.RESOLVER, Scan.DNS_PORT),
(socket.SOCK_STREAM, Scan.RESOLVER, Scan.DNS_PORT),
(socket.SOCK_DGRAM, "::1", Scan.DNS_PORT),
):
if how := ended_otherwise(kind, where, at):
what = "a TCP connection" if kind is socket.SOCK_STREAM else "a UDP datagram"
yield f"{what} from it to {where} at port {at} is not refused by the firewall ({how})"
def check(target: str) -> None:
name, port = address(target)
user = f"the scan's user ({Scan.USER})"
try:
socket.create_connection((name, port), Scan.TIMEOUT_S).close()
except OSError as error:
msg = (
f"As {user}, this runner could not connect to {name} at port {port} "
f"({error.strerror or error}). Nothing was scanned. If model_base_url names that "
"host, check that this runner can reach it. Then run the job again."
)
raise ScanUserError(msg) from error
if found := list(reaches(socket.gethostbyname(name), port)):
msg = (
f"The checks of {user} found that {'; '.join(found)}. Nothing was scanned. "
f"{Scan.PRIVATELY}"
)
raise ScanUserError(msg)
def become(command: list[str], variables: Mapping[str, str]) -> NoReturn:
"""Replace this process with `command`, under `variables`."""
os.execvpe(command[0], command, variables)
def stay(command: list[str], variables: Mapping[str, str]) -> NoReturn:
"""Lay an empty tmpfs over /run, since no firewall covers a Unix socket. Run `command` under
`variables` as process 1 of a PID namespace of its own, with that namespace's /proc. End it with
a TERM if a signal asks this process to end, and exit as it does."""
from lib.sandbox.kernel import Mount, Namespace, mount, unshare
quiet = Mount.NO_SETUID | Mount.NO_DEVICES | Mount.NO_EXEC
mount("tmpfs", "/run", quiet, "mode=755")
unshare(Namespace.PID)
child = os.fork()
if not child:
os.setsid()
mount("proc", "/proc", quiet)
become(command, variables)
def stop(*_signal: object) -> None:
with suppress(ProcessLookupError):
os.kill(child, signal.SIGTERM)
for number in (signal.SIGINT, signal.SIGTERM, signal.SIGHUP):
signal.signal(number, stop)
code = os.waitstatus_to_exitcode(os.waitpid(child, 0)[1])
sys.exit(code if code >= 0 else 128 - code)
VERBS: Final[Mapping[str, tuple[Callable[..., Launch | None], Callable[..., NoReturn] | None]]] = {
"host": (host, None),
"rules": (rules, None),
"start": (start, become),
"session": (session, become),
"view": (view, become),
"alone": (view, stay),
"end": (end, None),
"sweep": (sweep_as_root, None),
"check": (check, None),
}
def main(argv: Sequence[str]) -> int:
dashes = argv.index("--") if "--" in argv else len(argv)
verb, runs = VERBS[argv[0]]
try:
if (command_line := verb(*argv[1:dashes])) and runs:
runs([*command_line.before, *argv[dashes + 1 :]], command_line.variables)
except (ScanUserError, HostError, OSError, ValueError) as error:
sys.stderr.write(f"scan_user.py: {error}\n")
return 1
return 0
if __name__ == "__main__":
sys.exit(main(sys.argv[1:]))
|