help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Control of fan-speed on Lenovo Thinkpads


From: Jean Louis
Subject: Re: Control of fan-speed on Lenovo Thinkpads
Date: Thu, 1 Apr 2021 12:46:00 +0300
User-agent: Mutt/2.0.6 (2021-03-06)

* Stefan Monnier <monnier@iro.umontreal.ca> [2021-03-31 23:20]:
> > * Stefan Monnier <monnier@iro.umontreal.ca> [2021-03-31 17:24]:
> >> >  (let* ((sudo `(call-process "sudo" nil ,sudo-buffer t "su" "-c" "--" 
> >> > "root" "-c" ,command))
> >> >         (status (eval sudo))
> >> 
> >> Why?  No kitten needs to suffer here:
> >> 
> >>     (let* ((status (call-process "sudo" nil sudo-buffer t "su" "-c" "--" 
> >> "root" "-c" command))
> >
> > In that specific case yes. It works, I changed it. But it defeats
> > itself in purpose, do you see? That COMMAND is parameter to `su' which
> > invokes default user's shell. I don't find it bad, it just defeats the
> > purpose of `call-process'.
> 
> You still have the risk of "command" being incorrect because of
> messed up quoting, but not because of the shell you yourself invoke: just
> because of the shell invoked by `su`.  And since "command" is what you
> receive you can't do much better than that anyway.

Thank you.

The lesson is more important than this particular `sudo' function. As
now I have to improve other 158 functions with `shell-command' for
safety of quoting.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

Sign an open letter in support of Richard M. Stallman
https://rms-support-letter.github.io/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]