Re: [PATCH] mountpoint: symlinks are not mount points

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

 



On Fri, Aug 22, 2014 at 12:34:27AM +0300, Sami Kerola wrote:
> On 21 August 2014 22:28, Bernhard Voelker <mail@xxxxxxxxxxxxxxxxxxx> wrote:
> > On 08/21/2014 08:03 PM, Sami Kerola wrote:
> >> Earlier the mountpoint(1) followed symlinks
> >
> > IMO this is correct as symlinks only have to be treated
> > as such when explicitly not de-referencing.
> > As mountpoint(1) does not have a --no-dereference option,
> > symlinks should always be transparent for this tool.
> >
> > Furthermore, the patch would break scripts relying on existing
> > behavior:
> >
> >   $ ln -s / slink
> >
> >   $ /usr/bin/mountpoint slink
> >   slink is a mountpoint
> >
> >   $ # ~berny/util-linux/mountpoint slink
> >   slink is not a mountpoint
> 
> I don't share view symlinks are mount points.  In my mind they are
> pointers, much like street signs, giving a direction to somewhere without
> understanding what is there if anything at all.  But not breaking
> existing behavior is good point, so I changed the patch and added
> --no-dereference.

 I don't think we need the patch, it does not resolve or improve
 anything. It's over-engineering. If you don't like symlinks then you
 can use

  if [ ! -L $dir ]; then
     mountpoint $dir
  fi

> -	if (stat(spec, &st)) {
> +	if (lstat(spec, &st)) {

 btw, you want to use lstat() only when no_dereference is specified.


 Anyway, NACK. Sorry.

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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