[Pkg-shadow-devel] Bug#276419: su appends the positional args to the command line

Nicolas François Nicolas François , 276419@bugs.debian.org
Wed, 23 Mar 2005 23:43:13 +0100


Package: login
Version: 1:4.0.3-31sarge1
Followup-For: Bug #276419

Hello,

I had a look at this bug and came up with this patch.

This implementation is much simpler, so I wonder if I did not forget
something.


For the impatient, it could also have been solve by a proper escape:
$ su --shell=/bin/sh -c 'printf :%q:\\n ${1+"$@"}' "$USER" \
    sh su concatenates the "shell\'s" positional parameters \
    rather than passing them to execvp

or

$ su --shell=/bin/sh -c 'printf :%q:\\n ${1+"$@"}' "$USER" \
    sh su concatenates the "\"shell\'s\"" positional parameters \
    rather than passing them to execvp


Best Regards,
-- 
Nekral