Chris Knadle wrote:
Before you pointed out that Debian was behaving differently concerning the
resulting path after an su, I occasionally noticed documentation about using
'su -' to bring in root's path rather than the users' path, but I never ran
into a lack of having root's path when doing 'su' by itself rather than 'su -'
on Debian and didn't know why. I think dragorn's got the right answer of it
being concerns over possible exploits via the PATH.
I suppose when writing apps (including scripts) that others might use,
it's safer not to assume anything about PATH, and specify full paths to
everything.
That answers another question I was going to ask someday, why some
distros allow an unprivileged user to "poweroff" but others require
privileges.
This is a similar problem -- because powering off the box is something that
requires root-level privileges.
On some distros. I think it partially depends on whether the distro's
expected to be multiuser or single user.
For instance normally on Debian a user within KDE4 can choose "Shut down" to
power off the system; however this does /not/ work if the bootup init system
is systemd -- when running systemd the user is instead logged out and brought
back to the kdm login prompt, whereby the system /can/ be shutdown from there.
One of numerous distros on my test system is Debian, and that's one of
the few where a user can't run "poweroff". Thinking back to my college
days of mainframes with dozens of terminals, I certainly wouldn't want
any other user to be able to shut down the system at whim. My main
system is Mandriva, where any user can shut down the system.
So I agree with dragorn's answer of "because" on both of these, but I've added
a bit of detail you can look into if you want. ;-)
As I said above, I think part of it is the distro philosophy and whether
it's meant to be a single- or multiuser system. I'll keep that in mind
when using the numerous distros on my test system. Thanks!
Adam
_______________________________________________
Mid-Hudson Valley Linux Users Group http://mhvlug.org
http://mhvlug.org/cgi-bin/mailman/listinfo/mhvlug
Upcoming Meetings (6pm - 8pm) Vassar College
Dec 5 - SysAdmin Panel
Jan 9 - High Performance Computing
Feb 6 - February Meeting