if context.config.output_format == OutputFormat.directory:
return
- # GPG messes with the user's home directory so we run it as the invoking user.
-
- cmdline: list[PathString] = [
- "setpriv",
- f"--reuid={INVOKING_USER.uid}",
- f"--regid={INVOKING_USER.gid}",
- "--clear-groups",
- "gpg",
- "--detach-sign",
- ]
+ cmdline: list[PathString] = ["gpg", "--detach-sign"]
# Need to specify key before file to sign
if context.config.key is not None:
open(context.staging / context.config.output_checksum, "rb") as i,
open(context.staging / context.config.output_signature, "wb") as o,
):
- run(cmdline, env=env, stdin=i, stdout=o, sandbox=context.sandbox(mounts=mounts, options=options))
+ run(
+ cmdline,
+ env=env,
+ stdin=i,
+ stdout=o,
+ # GPG messes with the user's home directory so we run it as the invoking user.
+ sandbox=context.sandbox(
+ mounts=mounts,
+ options=options,
+ ) + ["setpriv", f"--reuid={INVOKING_USER.uid}", f"--regid={INVOKING_USER.gid}", "--clear-groups"]
+ )
def dir_size(path: Union[Path, os.DirEntry[str]]) -> int: