[Bug 410022] Re: sudo doesn't propagate $PWD

2011-01-27 Thread mmm
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

[Bug 410022] Re: sudo doesn't propagate $PWD

2009-08-07 Thread Mike Coleman
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

Re: [Bug 410022] Re: sudo doesn't propagate $PWD

2009-08-07 Thread Martin Pitt
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

[Bug 410022] Re: sudo doesn't propagate $PWD

2009-08-06 Thread Kamus
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 --

[Bug 410022] Re: sudo doesn't propagate $PWD

2009-08-06 Thread Mike Coleman
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

[Bug 410022] Re: sudo doesn't propagate $PWD

2009-08-06 Thread Kamus
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

[Bug 410022] Re: sudo doesn't propagate $PWD

2009-08-06 Thread Mike Coleman
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

[Bug 410022] Re: sudo doesn't propagate $PWD

2009-08-06 Thread Kamus
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

[Bug 410022] Re: sudo doesn't propagate $PWD

2009-08-06 Thread Kamus
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