diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2021-07-23 12:23:25 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2021-07-24 12:39:46 -0700 |
commit | 10f28b3adb1ed130d116ae3d4c81d098d214d2d8 (patch) | |
tree | dd5d0d1faf6e9bcd6962fac6474f9948afd46890 | |
parent | b6a83a1bd1c7c69316374c510aaff4b13054271e (diff) | |
download | consfigurator-10f28b3adb1ed130d116ae3d4c81d098d214d2d8.tar.gz |
fix comments about -c argument to su(1)
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rw-r--r-- | src/connection/setuid.lisp | 6 | ||||
-rw-r--r-- | src/connection/su.lisp | 3 | ||||
-rw-r--r-- | src/property/cron.lisp | 2 |
3 files changed, 7 insertions, 4 deletions
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)) diff --git a/src/property/cron.lisp b/src/property/cron.lisp index f568e14..a9cc81d 100644 --- a/src/property/cron.lisp +++ b/src/property/cron.lisp @@ -31,7 +31,7 @@ The output of the cronjob will be mailed only if the job exits nonzero." (:hostattrs ;; /etc/cron.* is Debian-specific. Also, we rely on runuser(1), which is ;; Linux-specific. This is done because su(1) for non-interactive usage - ;; has some pitfalls, and the command line argument '-c' is not portable. + ;; has some pitfalls. (os:required 'os:debianlike)) (let* ((times (not (keywordp when))) (dir (ensure-directory-pathname |