aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-05-23 15:13:17 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-05-23 16:55:50 -0700
commit65bcbf7c0931f379757e74280b0865c6da8f14be (patch)
tree2fe19d4d3e354cd844fce9ef2ec5e3dd818e5030
parent63c4e5f6230ccc6f2b095cfb031b466c8358b179 (diff)
downloadconsfigurator-65bcbf7c0931f379757e74280b0865c6da8f14be.tar.gz
add TODOs about non-portable uses of su(1)
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rw-r--r--src/connection/setuid.lisp2
-rw-r--r--src/connection/su.lisp1
2 files changed, 3 insertions, 0 deletions
diff --git a/src/connection/setuid.lisp b/src/connection/setuid.lisp
index 72d1ca8..2137f52 100644
--- a/src/connection/setuid.lisp
+++ b/src/connection/setuid.lisp
@@ -44,6 +44,8 @@
(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
(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 444ece2..05df15d 100644
--- a/src/connection/su.lisp
+++ b/src/connection/su.lisp
@@ -28,6 +28,7 @@
(defclass su-connection (shell-wrap-connection)
((user :initarg :user)))
+;; TODO -c is not portable to other su implementations.
(defmethod connection-shell-wrap ((connection su-connection) cmd)
(format nil "su ~A -c ~A"
(escape-sh-token (slot-value connection 'user))