On Mon, Apr 23, 2018 at 05:18:53PM -0400, Dan Streetman wrote:

> > The patch avoids locking at all when no_act == true. Consider this:
> >
> > iface foo inet ...
> >         pre-up ifquery --state bar
> >
> > iface bar inet ...
> >
> > Now if I call ifup foo and ifup bar at the same time, then the ifquery
> > might theoretically read a half-written /run/network/ifstate.bar.
> 
> Eh?
> 
> ifquery --state doesn't use the ifstate.* files.  It reads state from
> the global ifstate file.

Oh, you're absolutely right. It seems I mixed things up; ifquery --list
and "plain" ifquery lock ifstate.* files, but ifquery --state indeed
doesn't.

And indeed, with --state we only look at the global ifstate file. And
the other uses of ifquery only need to parse the interfaces file, so we
shouldn't ever need to touch the ifstate.* files when running ifquery.
But it's different for ifup and ifdown; even with --no-act we want to
lock. So I've made a patch to only avoid locking for ifquery.

-- 
Met vriendelijke groet / with kind regards,
      Guus Sliepen <g...@debian.org>

Attachment: signature.asc
Description: PGP signature

Reply via email to