From 10f28b3adb1ed130d116ae3d4c81d098d214d2d8 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Fri, 23 Jul 2021 12:23:25 -0700 Subject: fix comments about -c argument to su(1) Signed-off-by: Sean Whitton --- src/connection/setuid.lisp | 6 ++++-- src/connection/su.lisp | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src/connection') diff --git a/src/connection/setuid.lisp b/src/connection/setuid.lisp index e61222b..d1df1b6 100644 --- a/src/connection/setuid.lisp +++ b/src/connection/setuid.lisp @@ -48,8 +48,10 @@ (datadir (ensure-directory-pathname (stripln - ;; su(1) is not POSIX but very likely to be present - ;; TODO however, this use of su(1) uses a non-portable -c argument + ;; su(1) is not POSIX but very likely to be present. Note that + ;; the -c argument here is to the user's login shell, not the + ;; -c argument to su(1) on, e.g., FreeBSD. So should be fairly + ;; portable. (mrun "su" to "-c" "echo ${XDG_CACHE_HOME:-$HOME/.cache}/consfigurator/data/"))))) diff --git a/src/connection/su.lisp b/src/connection/su.lisp index 05df15d..785302f 100644 --- a/src/connection/su.lisp +++ b/src/connection/su.lisp @@ -28,7 +28,8 @@ (defclass su-connection (shell-wrap-connection) ((user :initarg :user))) -;; TODO -c is not portable to other su implementations. +;; Note that the -c here is an argument to the user's login shell, not the -c +;; argument to su(1) on, e.g., FreeBSD. So this should be fairly portable. (defmethod connection-shell-wrap ((connection su-connection) cmd) (format nil "su ~A -c ~A" (escape-sh-token (slot-value connection 'user)) -- cgit v1.2.3