Safe passing of subprocess arguments - always.
This commit is contained in:
parent
ee8aa95e24
commit
7f7d1c43c8
3 changed files with 13 additions and 13 deletions
|
@ -73,11 +73,10 @@
|
||||||
|
|
||||||
;; Mailman-specific process output lines capture
|
;; Mailman-specific process output lines capture
|
||||||
(define (get-mailman-output-lines bin . args)
|
(define (get-mailman-output-lines bin . args)
|
||||||
(get-process-output-lines
|
(apply
|
||||||
(string-intersperse
|
get-process-output-lines
|
||||||
(cons (mailman-bin bin)
|
(mailman-bin bin)
|
||||||
args)
|
args))
|
||||||
" ")))
|
|
||||||
|
|
||||||
;; Returns the list of available lists
|
;; Returns the list of available lists
|
||||||
(define (list-mailman-lists)
|
(define (list-mailman-lists)
|
||||||
|
|
|
@ -58,8 +58,8 @@
|
||||||
|
|
||||||
;; Very simple shell command wrapper that returns lines produced by
|
;; Very simple shell command wrapper that returns lines produced by
|
||||||
;; given command. Dangerous - performs no argument escaping!
|
;; given command. Dangerous - performs no argument escaping!
|
||||||
(define (get-process-output-lines cmd)
|
(define (get-process-output-lines cmd . args)
|
||||||
(let-values (((stdout stdin pid stderr) (process* cmd)))
|
(let-values (((stdout stdin pid stderr) (process* cmd args)))
|
||||||
(close-output-port stdin)
|
(close-output-port stdin)
|
||||||
(let ((result (read-lines stdout)))
|
(let ((result (read-lines stdout)))
|
||||||
(let-values (((a b c) (process-wait pid)))
|
(let-values (((a b c) (process-wait pid)))
|
||||||
|
|
|
@ -71,11 +71,12 @@
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(let loop ((lines
|
(let loop ((lines
|
||||||
(get-process-output-lines
|
(get-process-output-lines
|
||||||
(sprintf "git -C \"~A\" log -p -- \"~A\""
|
"git"
|
||||||
(string-translate* (*members-directory*)
|
"-C" (*members-directory*)
|
||||||
'(("\"" . "\\\"")))
|
"log"
|
||||||
(brmember-file-name mr)
|
"-p"
|
||||||
))))
|
"--"
|
||||||
|
(brmember-file-name mr))))
|
||||||
(when (not (null? lines))
|
(when (not (null? lines))
|
||||||
(print (car lines))
|
(print (car lines))
|
||||||
(loop (cdr lines))))))
|
(loop (cdr lines))))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue