Re: determining sudo access

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On Wed, Jan 19, 2011 at 15:07, Tim <ignored_mailbox@xxxxxxxxxxxx> wrote:
On Wed, 2011-01-19 at 14:34 -0800, Donald Russell wrote:
> In /etc/profile.d/local.sh I'd like to modify the PATH env variable to
> include /sbin /usr/sbin and /usr/local/sbin but only if the user has
> sudo access.

Even if that person does have sudo access, there are probably times when
they should use the command in /bin rather than /sbin, et cetera. ÂThere
are, or used to be, various commands that had different versions in
each.

If you mean for that path to change depending on whether they had used
the sudo command, that'd be a different thing, and would probably work
without problems.

hmmm, same program/command in different directories with different behaviour...
I guess the simplest thing is to let the people with sudo access adjust their own PATH in ~/.profile or the like.

But, to do as you suggest, only alter the path if the sudo command were used, would require a sudo function...

something like:
sudo() {
ÂÂÂ local oldath=${PATH}
ÂÂÂ PATH="/usr/local/sbin:/usr/sbin:/sbin:${PATH}"
ÂÂÂ /usr/bin/sudo $@
ÂÂÂ local retval=$?
ÂÂÂ PATH=${oldpath}
ÂÂÂ return ${retval}
}

Interesting idea...
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux