Sudo, kind of, create "invalid" environment for "user". Here one example:
(I am not sure is it related or is it wrong/bad)
root:~# mkdir tmp
root:~# chmod 0 ./tmp
root:~# ls -ld tmp
d- 2 root root tmp
root:~# cd tmp
root:~/tmp# sudo -u user bash
To run a command as administrator (user
I'm not that crazy about code that relies on $PWD, either, but
nonetheless there's quite a bit of it out there that does.
The reason I'm thinking of this is a bug is that virtually every
environment in which you can run a program under Linux will include a
$PWD variable, and similarly virtually ev
I don't think it's a good idea to rely on $PWD, the current directory
is as easily available as `pwd` or getcwd(), depending on whether you
use scripts/C/etc. Relying on environment variables seems error prone
and subject to forgery?
Anyway, this is not a sudo bug. "PWD" is set by bash and dash, a
Dear mike, if you really think that is a bug and easy to fix maybe you
should create a new report for onehundrerpapercut project. I took with
other guys from bug squad and we thought that you problem is not a bug,
but anyway please don't feel hesitate or something for my reply ;)
Best regards
--
With due respect, I believe that this is a bug, and not a question nor a
wishlist item. Either $PWD belongs in the sudo default environment or
it does not. If it does, this is a bug, it should be fixed, and
probably that won't be very difficult to do.
If $PWD is being left out of the default sud
Dear mike, you are welcome. If you are thinking that is a good idea to
implement in future versions of ubuntu this change, maybe you should
create a new report and declare in some part of something like "this is
a wishlist or idea to improve ubuntu ..". Anyway you should visit and
get further info
Kamus,
Thank you for your response. If you think this explanation should go in
the question database, I think that's great.
That notwithstanding, I would like this to be triaged as a bug. I
believe the default Ubuntu configuration should provide the $PWD
variable in the 'sudo' environment. Thi
This report was converted into a question because is not a effective
bug.
Regards
** Changed in: sudo (Ubuntu)
Status: New => Invalid
** Converted to question:
https://answers.launchpad.net/ubuntu/+source/sudo/+question/79333
--
sudo doesn't propagate $PWD
https://bugs.launchpad.net
Dear Mike, extract from https://help.ubuntu.com/community/Sudoers
Defaults env_reset , resets the terminal environment after switching to root.
So, ie: all user set variables are removed. The second (root ALL=(ALL) ALL)
just lets root do everything on any machine as any user. And the third (%adm