FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Development

 
 
LinkBack Thread Tools
 
Old 08-08-2012, 01:16 AM
Ulrich Dangel
 
Default Change default PATH for Jessie / wheezy+1

Currently the default PATH for Debian does not include /sbin, /usr/sbin, nor
/usr/local/sbin. If an user wants to run a program in either /sbin/ or /usr/sbin
the full path must be specified.

Some programs don't necessarily need root privileges like blkid, iwconfig,
ifconfig, service etc. and can be partially useful for the normal user.

If a program requires root privileges, sudo is nowadays a standard solution (the
debian installer even automatically installs sudo undder specific circumstances).
To run a program as root with sudo the user must specify the correct path, e.g.
sudo /usr/sbin/visudo instead of just sudo visudo or su -c visudo.

Changing the default PATH for normal users to include /sbin, /usr/sbin as well as
/usr/local/sbin would be a great thing for simplifying command line usage for
normal users.

If /sbin, /usr/sbin and /usr/local/sbin are added at the end of the PATH there
should be no problems for existing environments if there are programs with the
same name in /sbin and /bin…

I know that these changes are late in the release cycle so I suggest to make the
changes for Jessie.

cheers,
Ulrich


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 5021BE0B.1020303@spamt.net">http://lists.debian.org/5021BE0B.1020303@spamt.net
 
Old 08-08-2012, 01:27 AM
The Fungi
 
Default Change default PATH for Jessie / wheezy+1

On 2012-08-08 03:16:59 +0200 (+0200), Ulrich Dangel wrote:
[...]
> To run a program as root with sudo the user must specify the
> correct path, e.g. sudo /usr/sbin/visudo instead of just sudo
> visudo or su -c visudo.
[...]

Are you certain? For me, 'ifconfig' as a normal user returns
"command not found" but 'sudo ifconfig' works just fine...
--
{ IRL(Jeremy_Stanley); WWW(http://fungi.yuggoth.org/); PGP(43495829);
WHOIS(STANL3-ARIN); SMTP(fungi@yuggoth.org); FINGER(fungi@yuggoth.org);
MUD(kinrui@katarsis.mudpy.org:6669); IRC(fungi@irc.yuggoth.org#ccl); }


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20120808012715.GJ3274@yuggoth.org">http://lists.debian.org/20120808012715.GJ3274@yuggoth.org
 
Old 08-08-2012, 01:48 AM
Ulrich Dangel
 
Default Change default PATH for Jessie / wheezy+1

On 08/08/12 03:27, The Fungi wrote:

> Are you certain? For me, 'ifconfig' as a normal user returns
> "command not found" but 'sudo ifconfig' works just fine...

I was based on my experiments[1]. But I discovered that my
/etc/sudoers didn't contain following config line:

Defaults secure_path
"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/

So ignore the sudo part as it should be no problem. The bash completion even
changes PATH to contain the sbin directories for sudo but zsh seems to honor PATH
and doesn't extend to check for programs.

Ulrich

[1]
$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
$ sudo visudo
sudo: visudo: command not found
$ export PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/sbin:/usr/sbin
$ sudo visudo
visudo: /etc/sudoers.tmp unchanged




--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 5021C580.70000@spamt.net">http://lists.debian.org/5021C580.70000@spamt.net
 
Old 08-08-2012, 01:54 AM
Clint Adams
 
Default Change default PATH for Jessie / wheezy+1

On Wed, Aug 08, 2012 at 03:48:48AM +0200, Ulrich Dangel wrote:
> So ignore the sudo part as it should be no problem. The bash completion even
> changes PATH to contain the sbin directories for sudo but zsh seems to honor PATH
> and doesn't extend to check for programs.

Perhaps you have changed your /etc/zsh/zshrc or you aren't enabling
the modern completion system.


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20120808015425.GA27852@scru.org">http://lists.debian.org/20120808015425.GA27852@scru.org
 
Old 08-08-2012, 02:09 AM
Ulrich Dangel
 
Default Change default PATH for Jessie / wheezy+1

On 08/08/12 03:54, Clint Adams wrote:
> On Wed, Aug 08, 2012 at 03:48:48AM +0200, Ulrich Dangel wrote:
>> So ignore the sudo part as it should be no problem. The bash completion even
>> changes PATH to contain the sbin directories for sudo but zsh seems to honor PATH
>> and doesn't extend to check for programs.
>
> Perhaps you have changed your /etc/zsh/zshrc or you aren't enabling
> the modern completion system.

Ah yes ☹ I am using Grmls zshrc which doesn't contain the zstyle for changing the
behavior. With the zstyle (in Debians default zshrc)

zstyle ':completion:*:sudo:*' command-path /usr/local/sbin /usr/local/bin
/usr/sbin /usr/bin /sbin /bin /usr/X11R6/bin

the completion works with zsh as well.


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 5021CA56.1010306@spamt.net">http://lists.debian.org/5021CA56.1010306@spamt.net
 
Old 08-08-2012, 02:11 AM
 
Default Change default PATH for Jessie / wheezy+1

On Aug 08, Ulrich Dangel <uli@spamt.net> wrote:

> Changing the default PATH for normal users to include /sbin, /usr/sbin as well as
> /usr/local/sbin would be a great thing for simplifying command line usage for
> normal users.
Fedora did it a few months ago, so probably we should do it as well to
minimize the pain.

> If /sbin, /usr/sbin and /usr/local/sbin are added at the end of the PATH there
> should be no problems for existing environments if there are programs with the
> same name in /sbin and /bin…
I do not think that this is an actual problem, and if it were then it
should be fixed: when sbin is in the path it has always been before
other directories, so changing this only for some cases would be confusing.
Just use the same path for all users.

--
ciao,
Marco
 
Old 08-08-2012, 02:15 AM
Russ Allbery
 
Default Change default PATH for Jessie / wheezy+1

Ulrich Dangel <uli@spamt.net> writes:

> Currently the default PATH for Debian does not include /sbin, /usr/sbin,
> nor /usr/local/sbin. If an user wants to run a program in either /sbin/
> or /usr/sbin the full path must be specified.

I don't see any point in doing this as opposed to just moving everything
from sbin into bin and making sbin a symlink to bin. If we're going to
add them both to the PATH, that means there's no longer any effective
difference, and we should make that explicit.

Let's not create another halfway situation that makes no sense in its own
right and exists only because we can't make up our mind between two
mutually-exclusive alternatives. Either it makes sense to separate root
commands from regular user commands or it doesn't.

--
Russ Allbery (rra@debian.org) <http://www.eyrie.org/~eagle/>


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 87sjbyuo2h.fsf@windlord.stanford.edu">http://lists.debian.org/87sjbyuo2h.fsf@windlord.stanford.edu
 
Old 08-08-2012, 02:32 AM
Carlos Alberto Lopez Perez
 
Default Change default PATH for Jessie / wheezy+1

On 08/08/12 03:16, Ulrich Dangel wrote:
> Currently the default PATH for Debian does not include /sbin, /usr/sbin, nor
> /usr/local/sbin. If an user wants to run a program in either /sbin/ or /usr/sbin
> the full path must be specified.
>
> Some programs don't necessarily need root privileges like blkid, iwconfig,
> ifconfig, service etc. and can be partially useful for the normal user.
>
> If a program requires root privileges, sudo is nowadays a standard solution (the
> debian installer even automatically installs sudo undder specific circumstances).
> To run a program as root with sudo the user must specify the correct path, e.g.
> sudo /usr/sbin/visudo instead of just sudo visudo or su -c visudo.
>
> Changing the default PATH for normal users to include /sbin, /usr/sbin as well as
> /usr/local/sbin would be a great thing for simplifying command line usage for
> normal users.
>
> If /sbin, /usr/sbin and /usr/local/sbin are added at the end of the PATH there
> should be no problems for existing environments if there are programs with the
> same name in /sbin and /bin…
>
> I know that these changes are late in the release cycle so I suggest to make the
> changes for Jessie.
>

I think this is a great idea

You can't imagine how much I blame Debian each time I have to type the
full path "/sbin/ifconfig" as a non-root user on virtual servers to just
know the IP address the DHCP server assigned to the machine.
 
Old 08-08-2012, 02:41 AM
Ulrich Dangel
 
Default Change default PATH for Jessie / wheezy+1

On 08/08/12 04:11, Marco d'Itri wrote:
>> Changing the default PATH for normal users to include /sbin, /usr/sbin as well as
>> /usr/local/sbin would be a great thing for simplifying command line usage for
>> normal users.
> Fedora did it a few months ago, so probably we should do it as well to
> minimize the pain.

As far as I know (based on <https://bugzilla.redhat.com/show_bug.cgi?id=458176> /
http://fedoraproject.org/wiki/Features/SbinSanity ) Fedora changed it in 2008.

It seems that Ubuntu also has the sbin directories in PATH per default (via
/etc/environment) since at least 2006.

Ulrich



--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 5021D1DF.40601@spamt.net">http://lists.debian.org/5021D1DF.40601@spamt.net
 
Old 08-08-2012, 02:54 AM
Ulrich Dangel
 
Default Change default PATH for Jessie / wheezy+1

On 08/08/12 04:15, Russ Allbery wrote:

>> Currently the default PATH for Debian does not include /sbin, /usr/sbin,
>> nor /usr/local/sbin. If an user wants to run a program in either /sbin/
>> or /usr/sbin the full path must be specified.
>
> I don't see any point in doing this as opposed to just moving everything
> from sbin into bin and making sbin a symlink to bin. If we're going to
> add them both to the PATH, that means there's no longer any effective
> difference, and we should make that explicit.

A similar solution was discussed some time ago by merging all the /bin and /sbin
directories together (based on the UsrMove from Fedora) but the discussion wasn't
really productive iirc.

Changing only the PATH is also less intrusive compared to merging /{s,}bin and
/usr/{s,}bin. But if there is a consent for it, sure let's merge the directories.

Ulrich
 

Thread Tools




All times are GMT. The time now is 04:03 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org