diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2021-04-16 20:33:05 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2021-04-16 20:35:39 -0700 |
commit | 42b390533e1faafe7c5cbb23eb0b39315b403dca (patch) | |
tree | c0e839f9018b055622f9bade698506922ba684b3 /src/connection.lisp | |
parent | 310961aedca8ac1609228880b882c791a028977b (diff) | |
download | consfigurator-42b390533e1faafe7c5cbb23eb0b39315b403dca.tar.gz |
add WITH-LOCAL-PASSWORDLESS-SUDO-CONNECTION
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/connection.lisp')
-rw-r--r-- | src/connection.lisp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/connection.lisp b/src/connection.lisp index c666de3..bc19c26 100644 --- a/src/connection.lisp +++ b/src/connection.lisp @@ -446,3 +446,11 @@ FORMS is typically the programmatic application of one or more properties." `(let ((*host* (make-host :propspec (make-propspec :systems nil))) (*connection* (establish-connection :local nil))) ,@forms)) + +(defmacro with-local-passwordless-sudo-connection (&body forms) + "Execute FORMS as though a passwordless :SUDO connection to localhost had been +established. Occasionally useful for testing purposes at the REPL." + `(with-local-connection + (let ((*connection* (establish-connection :sudo nil + :user "root" :password nil))) + ,@forms))) |