Re: question about hardcoded binary paths (swapon / mkswap)

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

 



On 02 Apr 2015 10:20, Karel Zak wrote:
> On Wed, Apr 01, 2015 at 09:12:30PM -0400, Mike Frysinger wrote:
> > On 01 Apr 2015 23:38, Karel Zak wrote:
> > > On Wed, Apr 01, 2015 at 10:06:52PM +0100, Ruediger Meier wrote:
> > > > > > Maybe both cases also with or without fallback $sbindir, /sbin or
> > > > > > $PATH.
> > > > > >
> > > > > > I guess we should agree how somthing like this should be handeled
> > > > > > in general. "eject" is also using hardcoded "/bin/umount".
> > > > >
> > > > > seems like $PATH should always be used.  if you broke $PATH, well
> > > 
> > > Yes, agree.
> > >  
> > > Note that we already have and use FS_SEARCH_PATH in mkfs, fsck and
> > > mount (libmount), see --enable-fs-paths-default and  --enable-fs-paths-extra.
> > 
> > what's the reason for having FS_SEARCH_PATH anymore ? 
> 
> If I good remember then the reason is that the helpers does not have
> to be installed in standard PATH. Well, you're author of this thing
> :-)

i wrote the code to make it a configure option, but the actual behavior predates 
me.  i'm interested more in the behavior, not the exact configure option.

looks like mkfs added it during the 2.2->2.5 transition, but otherwise no 
details in the bundled NEWS that i saw.  oh well.

> > neither tool is set*id, 
> > and mkfs/fsck generally live in /sbin.  i guess if you're non-root and have 
> > /sbin/mkfs hardcoded in a script, then dropping FS_SEARCH_PATH might break 
> > existing code.
> 
> for systemd based distors the path should be also modified, we have
> all in /usr and /sbin and /bin are symlinks only.

but they'll still be in $PATH ?

> > > Maybe we can use it use FS_SEARCH_PATH also for mkswap in swapon, or use it
> > > as fallback.
> > 
> > my preference would be to not move more tools into that system and allow any 
> > more implicit lookups to leak out.
> 
> I'm happy that for example mount(8) does not waste time with all PATH,
> but it cares about /sbin only. IMHO it's fine that mkfs, mount and
> fsck assume *helpers* on specific place. The mkswap is different, it's 
> standard command and it's expected in PATH.

mount makes sense as it's set*id and we can't trust users to not be evil :).
-mike

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux