* [bug#37039] [PATCH] machine: Use 'become-command'.
@ 2019-08-15 16:09 Jakob L. Kreuze
2019-08-16 12:47 ` Christopher Lemmer Webber
0 siblings, 1 reply; 2+ messages in thread
From: Jakob L. Kreuze @ 2019-08-15 16:09 UTC (permalink / raw)
To: 37039
[-- Attachment #1: Type: text/plain, Size: 2509 bytes --]
* gnu/machine/ssh.scm (managed-host-remote-eval): Pass an appropriate
'become-command' to 'remote-eval'.
* guix/ssh.scm (remote-authorize-signing-key): Add optional
'become-command' argument.
All callers changed.
---
gnu/machine/ssh.scm | 7 +++++--
guix/ssh.scm | 5 +++--
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/gnu/machine/ssh.scm b/gnu/machine/ssh.scm
index ac3aa3e370..aafe0ccf41 100644
--- a/gnu/machine/ssh.scm
+++ b/gnu/machine/ssh.scm
@@ -126,7 +126,9 @@ an environment type of 'managed-host."
#:build-locally?
(machine-ssh-configuration-build-locally? config)
#:system
- (machine-ssh-configuration-system config))))
+ (machine-ssh-configuration-system config)
+ #:become-command
+ (machine-become-command machine))))
\f
;;;
@@ -377,7 +379,8 @@ have you run 'guix archive --generate-key?'")
(lambda (port)
(string->canonical-sexp
(get-string-all port))))
- (machine-ssh-session machine)))
+ (machine-ssh-session machine)
+ (machine-become-command machine)))
(mlet %store-monad ((_ (check-deployment-sanity machine))
(boot-parameters (machine-boot-parameters machine)))
(let* ((os (machine-operating-system machine))
diff --git a/guix/ssh.scm b/guix/ssh.scm
index 24834c6f68..7bc499a2fe 100644
--- a/guix/ssh.scm
+++ b/guix/ssh.scm
@@ -302,7 +302,7 @@ the machine on the other end of SESSION."
(inferior-remote-eval '(begin (use-modules (guix utils)) (%current-system))
session))
-(define (remote-authorize-signing-key key session)
+(define* (remote-authorize-signing-key key session #:optional become-command)
"Send KEY, a canonical sexp containing a public key, over SESSION and add it
to the system ACL file if it has not yet been authorized."
(inferior-remote-eval
@@ -321,7 +321,8 @@ to the system ACL file if it has not yet been authorized."
(mkdir-p (dirname %acl-file))
(with-atomic-file-output %acl-file
(cut write-acl acl <>)))))
- session))
+ session
+ become-command))
(define* (send-files local files remote
#:key
--
2.22.0
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [bug#37039] [PATCH] machine: Use 'become-command'.
2019-08-15 16:09 [bug#37039] [PATCH] machine: Use 'become-command' Jakob L. Kreuze
@ 2019-08-16 12:47 ` Christopher Lemmer Webber
0 siblings, 0 replies; 2+ messages in thread
From: Christopher Lemmer Webber @ 2019-08-16 12:47 UTC (permalink / raw)
To: 37039; +Cc: 37039-done
Looks fine and simple. Merged and pushed.
Jakob L. Kreuze writes:
> * gnu/machine/ssh.scm (managed-host-remote-eval): Pass an appropriate
> 'become-command' to 'remote-eval'.
> * guix/ssh.scm (remote-authorize-signing-key): Add optional
> 'become-command' argument.
> All callers changed.
> ---
> gnu/machine/ssh.scm | 7 +++++--
> guix/ssh.scm | 5 +++--
> 2 files changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/gnu/machine/ssh.scm b/gnu/machine/ssh.scm
> index ac3aa3e370..aafe0ccf41 100644
> --- a/gnu/machine/ssh.scm
> +++ b/gnu/machine/ssh.scm
> @@ -126,7 +126,9 @@ an environment type of 'managed-host."
> #:build-locally?
> (machine-ssh-configuration-build-locally? config)
> #:system
> - (machine-ssh-configuration-system config))))
> + (machine-ssh-configuration-system config)
> + #:become-command
> + (machine-become-command machine))))
>
> \f
> ;;;
> @@ -377,7 +379,8 @@ have you run 'guix archive --generate-key?'")
> (lambda (port)
> (string->canonical-sexp
> (get-string-all port))))
> - (machine-ssh-session machine)))
> + (machine-ssh-session machine)
> + (machine-become-command machine)))
> (mlet %store-monad ((_ (check-deployment-sanity machine))
> (boot-parameters (machine-boot-parameters machine)))
> (let* ((os (machine-operating-system machine))
> diff --git a/guix/ssh.scm b/guix/ssh.scm
> index 24834c6f68..7bc499a2fe 100644
> --- a/guix/ssh.scm
> +++ b/guix/ssh.scm
> @@ -302,7 +302,7 @@ the machine on the other end of SESSION."
> (inferior-remote-eval '(begin (use-modules (guix utils)) (%current-system))
> session))
>
> -(define (remote-authorize-signing-key key session)
> +(define* (remote-authorize-signing-key key session #:optional become-command)
> "Send KEY, a canonical sexp containing a public key, over SESSION and add it
> to the system ACL file if it has not yet been authorized."
> (inferior-remote-eval
> @@ -321,7 +321,8 @@ to the system ACL file if it has not yet been authorized."
> (mkdir-p (dirname %acl-file))
> (with-atomic-file-output %acl-file
> (cut write-acl acl <>)))))
> - session))
> + session
> + become-command))
>
> (define* (send-files local files remote
> #:key
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-08-16 12:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-15 16:09 [bug#37039] [PATCH] machine: Use 'become-command' Jakob L. Kreuze
2019-08-16 12:47 ` Christopher Lemmer Webber
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).