From 42b390533e1faafe7c5cbb23eb0b39315b403dca Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Fri, 16 Apr 2021 20:33:05 -0700 Subject: add WITH-LOCAL-PASSWORDLESS-SUDO-CONNECTION Signed-off-by: Sean Whitton --- src/connection.lisp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/connection.lisp') 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))) -- cgit v1.2.3