On Sun, May 31, 2020 at 01:49:24PM +0100, Pádraig Brady wrote:
> On 31/05/2020 10:36, Bernhard Voelker wrote:
> > On 2020-05-31 01:07, Paul Eggert wrote:
> > > On 5/30/20 4:49 AM, Erik Auerswald wrote:
> > > > I concur that a command line option to override config file (or env var)
> > > > settings seems useful if a config file and/or env var approach is used.
> > 
> > Just to mention another alternative to control the behavior besides env 
> > variables or
> > config files: it would theoretically also be possible to add a 
> > './configure' option
> > to add more file system types to the list of pseudofilesystems at build 
> > time.
> > Obviously, such idea moves the responsibility to the packager - which is not
> > nice either.
> > 
> > > In other utilities we've been moving away from environment variables 
> > > and/or
> > > config files for the usual security and other-hassle reasons. So I'd 
> > > prefer
> > > having 'df' just do the "right" thing by default, and to have an option to
> > > override that. The "right" thing should be to ignore all these 
> > > pseudofilesystems
> > > that hardly anybody cares about.
> > 
> > +1

That sounds logical, and it'd certainly be least hassle for us as well.

> > What about to start with this?
> > 
> >    $ GIT_PAGER= git -C gnulib diff
> >    diff --git a/lib/mountlist.c b/lib/mountlist.c
> >    index 7abe0248e..5f6249dec 100644
> >    --- a/lib/mountlist.c
> >    +++ b/lib/mountlist.c
> >    @@ -164,6 +164,9 @@
> > 
> >     #define ME_DUMMY_0(Fs_name, Fs_type)            \
> >       (strcmp (Fs_type, "autofs") == 0              \
> >    +   || strcmp (Fs_type, "tmpfs") == 0            \
> 
> tmpfs is consumable, so wouldn't be appropriate to add I think
> 
> >    +   || strcmp (Fs_type, "devtmpfs") == 0         \
> >    +   || strcmp (Fs_type, "squashfs") == 0         \
> >        || strcmp (Fs_type, "proc") == 0             \
> >        || strcmp (Fs_type, "subfs") == 0            \
> >        /* for Linux 2.6/3.x */                      \

This code appears to be part of gnulib, so I take it the patch would
need to be added there?  Would it also need updates to any tests, docs,
or other code?

You mentioned above this would need an option to override.  I checked
that `df -a` works as expected, but `df -t squashfs` just says:

  src/df: no file systems processed

It looks like -t only works from the filtered fs list, not on the
excluded dummy systems, so it's a consistent behavior.  However, I do
agree it could be nice for users to have a way to override the default
behavior; are you thinking a new option would be added?  If so can you
outline your thoughts on how that should work?

Thanks,
Bryce



Reply via email to