sudo: Sudo Command Processes
1 Introduction
(system*/sudo "/sbin/do-stuff" "remove" ".*video.*" "costing" ">" "$0")
(system* "/usr/bin/sudo" "-u" "root" "/sbin/do-stuff" "remove" ".*video.*" "costing" ">" "$0")
(system* "/sbin/do-stuff" "remove" ".*video.*" "costing" ">" "$0")
(system* "/usr/local/bin/gksudo" "-u" "root" "/sbin/do-stuff remove \".*video.*\" costing \">\" \"\\$0\"")
(subprocess/sudo #:user "postgres" #f #f #f "/usr/bin/psql" "-h" my-database-host "-d" my-database-name)
2 Interface
(or/c 'sudo 'gksudo absolute-path? (listof (or/c 'sudo 'gksudo absolute-path?)))
'sudo – The normal sudo program, in one of a few conventional places, if the executable file exists.
'gksudo – The gksudo program, in one of a few conventional places, if the executable file exists, and only if X is in use. Currently, X in use is determined by whether or not the DISPLAY environment variable is set.
An absolute path, which is used if the executable file exists there. It is then called with the syntax of normal sudo. Note that, since gksudo uses a different command line syntax than sudo, if you want to use gksudo, generally you must use the 'gksudo value instead of an absolute path.
parameter
(current-sudo val) → void? val : sudo?
procedure
(system*/sudo [ #:user user #:sudo sudo] command arg ...) → any user : string? = "root" sudo : sudo? = (current-sudo) command : absolute-path? arg : any/c
procedure
(system*/exit-code/sudo [ #:user user #:sudo sudo] command arg ...) → any user : string? = "root" sudo : sudo? = (current-sudo) command : absolute-path? arg : any/c
procedure
(process*/sudo [ #:user user #:sudo sudo] command arg ...) → any user : string? = "root" sudo : sudo? = (current-sudo) command : absolute-path? arg : any/c
procedure
(process*/ports/sudo [ #:user user #:sudo sudo] out in error-out command arg ...) → any user : string? = "root" sudo : sudo? = (current-sudo) out : any/c in : any/c error-out : any/c command : absolute-path? arg : any/c
3 Known Issues
Add standard KdeSudo support. This is probably just a matter of finding documentation or setting up a system on which to test, since we have not yet seen clear documentation of syntax.
Permit sudo? to accept a value of a pair of an absolute path and a symbol denoting syntax.
Determine any other conventional places in filesystem for the executables to be found.
Possibly change the conservative quoting and escaping of 'gksudo, to permit more characters, without being unsafe.
4 History
- Version 2:1 —
2016-03-07 Tweaked title, deps, filenames.
- Version 2:0 —
2016-02-26 Moving from PLaneT to new package system.
- Version 1:1 —
2012-10-07 Fixed "main.rkt".
Documentation tweaks.
- Version 1:0 —
2012-10-06 Initial release.
5 Legal
Copyright 2012, 2016 Neil Van Dyke. This program is Free Software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. See http://www.gnu.org/licenses/ for details. For other licenses and consulting, please contact the author.