[pacman-dev] [PATCH 1/3] makepkg: simplify su/sudo calling logic

Andres P aepd87 at gmail.com
Fri Jun 18 20:50:23 EDT 2010


On Fri, Jun 18, 2010 at 8:17 PM, Andres P <aepd87 at gmail.com> wrote:
> * Before, calls to sudo were not being word-split, whereas falling back to su,
>  for some reason, meant applying IFS to the arguments. From now on calling
>  either does not mangle any of the operands.
>
> * Instead of recreating the basic bash concept of $? with $ret, opt for
>  stacking the command line into a variable that can later be checked *once*
>  for a return code.
>

Note that this still has the "using su fucks up the terminal" bug present in
3.4.

When makepkg uses su for any reason, fallback or not, the terminal will no
longer display stdin and has to be reset(1).

To reproduce:
# mv /usr/bin/sudo{,~}

Then use a makepkg operation that requires root; e.g. -i or -s.

I can reproduce outside of makepkg:
$ fakeroot bash -c "su -c 'pacman -Q foo'"

But this is *just* an example. These calls do not involve fakeroot.

Andres P


More information about the pacman-dev mailing list