Created attachment 1819 [details] Small patch (use "git am") to unbreak sieve config on FreeBSD This patch treats FreeBSD like OpenBSD in the configuration. "%ms" seems GNU/Linux specific so maybe reversing the logic might be better. Also, add extra check when accessing config->host to make sure it isn't null. Patch is suitable for use with "git am". Also affects latest release (3.15.1).
Changes related to this bug have been committed. Please check latest Git and update the bug accordingly. You can also get the patch from: http://git.claws-mail.org/ ++ ChangeLog 2017-11-27 13:18:03.298951295 +0100 http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=6e6a6fe02182423fe7d723dc290ccfc1701a4642 Merge: 77c3e57 a4b3b84 Author: Colin Leroy <colin@colino.net> Date: Mon Nov 27 13:18:02 2017 +0100 Merge branch 'master' of file:///home/git/claws http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=a4b3b845e91a3d12a81d372b8635eaf76923071f Author: Michael Gmelin <freebsd@grem.de> Date: Sun Nov 26 21:09:22 2017 +0100 Fix bug #3924: Unbreak sieve host configuration on FreeBSD Also, adds extra check for config->host
Thanks for the patch!
Thanks for applying the patch so quickly. Please note that it might make sense to simply make the code for win/openbsd and freebsd the default and get rid of the ifdefs. I don't think using "%ms" buys that much and it might still break on mac os x, netbsd etc. in its current state. My itch has been scratched though, so thank you again.
(In reply to comment #3) > Thanks for applying the patch so quickly. > > Please note that it might make sense to simply make the code for win/openbsd > and freebsd the default and get rid of the ifdefs. I don't think using "%ms" > buys that much and it might still break on mac os x, netbsd etc. in its > current state. Well, it's very convenient to avoid dealing with fixed-length buffers in the application and let the underlying library do it better :-) https://stackoverflow.com/questions/38685724/difference-between-ms-and-s-scanf Haven't heard about others breaking, but maybe there's a better way to protect the %ms usage with feature flags.
(In reply to comment #4) > (In reply to comment #3) > > Thanks for applying the patch so quickly. > > > > Please note that it might make sense to simply make the code for win/openbsd > > and freebsd the default and get rid of the ifdefs. I don't think using "%ms" > > buys that much and it might still break on mac os x, netbsd etc. in its > > current state. > > Well, it's very convenient to avoid dealing with fixed-length buffers in the > application and let the underlying library do it better :-) > > https://stackoverflow.com/questions/38685724/difference-between-ms-and-s- > scanf > > Haven't heard about others breaking, but maybe there's a better way to > protect the %ms usage with feature flags. It's certainly convenient when you work on just one platform that supports it (and safer too). As claws is multi-platform, you end up with a lot more code to maintain and test (and leaving some platforms vulnerable). Even with feature flags you would end up with mupltiple code paths, so I'm not sure how it's useful in this case. If anything, some sort of project-global wrapper could make sense. Anyway, like I said, it works for me now :)