Re: A bug in commit: Use flock() for --concurrent option

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

 



Hi Chen Tang,

On Fri, Jan 12, 2018 at 08:12:01AM +0000, Tangchen (UVP) wrote:
> I found a problem with this commit, 
> 
> Use flock() for --concurrent option
> The previous locking mechanism was not atomic, hence it was possible
> that a killed ebtables process would leave the lock file in place which
> in turn made future ebtables processes wait indefinitely for the lock to
> become free.
> 
> Fix this by using flock(). This also simplifies code quite a bit because
> there is no need for a custom signal handler or an __exit routine
> anymore.
> 
> Signed-off-by: Phil Sutter <phil@xxxxxx>
> Signed-off-by: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>
> 
> if /var/lib/ebtables/ does not exist, ebtables cannot create the lock file.
> 
> # ls /var/lib/ebtables
> ls: cannot access /var/lib/ebtables: No such file or directory
> # ebtables --concurrent -L
> Unable to create lock file /var/lib/ebtables/lock.

Thanks for reporting this! I missed that the old code calls mkdir() in
one of the error paths. Will send a follow-up patch in a moment.

Cheers, Phil
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux