> On 9 Nov 2020, at 14:51, Andrew Bartlett <abartlet at samba.org> wrote: > On Mon, 2020-11-09 at 14:43 +1030, O'Connor, Daniel wrote: >> >> Good idea. >> First step is building Samba from source which is not a fun >> experience on FreeBSD :( > > We do honestly want to make this easier. Now of course that doesn't > help for a historical bisect, but we are open to and encourage up- > streaming of patches from ports. (We also ask that patches we reject - > this has happened - be removed from the port, but can't force that).I managed to get the build done with the patches from the FreeBSD port (plus a few mods where they did not apply). However the problem is when I go to bisect all those patches need to be manually re-applied (eg stash push/pop) and then hand fixed which is quite tedious.. I did a bit more digging and 4.12.7 works, 4.13.0 is broken (and HEAD). One thing I did notice is that the ldb libraries are linked in a different order: Broken: libldb.so.2 => /usr/local/lib/samba4/private/libldb.so.2 (0x80066e000) libldb-cmdline-samba4.so => /usr/local/lib/samba4/private/libldb-cmdline-samba4.so (0x8006a5000) libreplace-samba4.so => /usr/local/lib/samba4/private/libreplace-samba4.so (0x8006ad000) libtdb.so.1 => /usr/local/lib/libtdb.so.1 (0x8006b4000) libpopt.so.0 => /usr/local/lib/libpopt.so.0 (0x8006d0000) libtalloc.so.2 => /usr/local/lib/libtalloc.so.2 (0x8006df000) libtevent.so.0 => /usr/local/lib/libtevent.so.0 (0x8006f0000) libc.so.7 => /lib/libc.so.7 (0x80024a000) libthr.so.3 => /lib/libthr.so.3 (0x800706000) libintl.so.8 => /usr/local/lib/libintl.so.8 (0x800733000) Works: libldb-cmdline-samba4.so => /usr/local/lib/samba4/private/libldb-cmdline-samba4.so (0x80066e000) libldb.so.2 => /usr/local/lib/samba4/private/libldb.so.2 (0x800676000) libreplace-samba4.so => /usr/local/lib/samba4/private/libreplace-samba4.so (0x8006ad000) libtdb.so.1 => /usr/local/lib/libtdb.so.1 (0x8006b4000) libtevent.so.0 => /usr/local/lib/libtevent.so.0 (0x8006d0000) libtalloc.so.2 => /usr/local/lib/libtalloc.so.2 (0x8006e6000) libpopt.so.0 => /usr/local/lib/libpopt.so.0 (0x8006f7000) libc.so.7 => /lib/libc.so.7 (0x80024a000) libthr.so.3 => /lib/libthr.so.3 (0x800706000) libintl.so.8 => /usr/local/lib/libintl.so.8 (0x800733000) Although it could just be a red herring :) I've emailed the FreeBSD port maintainer to see about tracking it down. -- Daniel O'Connor "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum
Hi from the future! On Mon, 9 Nov 2020 at 08:13, O'Connor, Daniel via samba < samba at lists.samba.org> wrote:> > > On 9 Nov 2020, at 14:51, Andrew Bartlett <abartlet at samba.org> wrote: > > On Mon, 2020-11-09 at 14:43 +1030, O'Connor, Daniel wrote: > >> > >> Good idea. > >> First step is building Samba from source which is not a fun > >> experience on FreeBSD :( > > > > We do honestly want to make this easier. Now of course that doesn't > > help for a historical bisect, but we are open to and encourage up- > > streaming of patches from ports. (We also ask that patches we reject - > > this has happened - be removed from the port, but can't force that). > > I managed to get the build done with the patches from the FreeBSD port > (plus a few mods where they did not apply). > > However the problem is when I go to bisect all those patches need to be > manually re-applied (eg stash push/pop) and then hand fixed which is quite > tedious.. > > I did a bit more digging and 4.12.7 works, 4.13.0 is broken (and HEAD). >The (quite rude, TBH) https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=252385 suggests, that the problem, possibly, was introduced by introduced by this Volker's commit: https://gitlab.com/samba-team/devel/samba/-/commit/011a2a82953fa910e1e7dee9862fbb5deaae8651 where sscanf() is invoked with unsupported by FreeBSD `%m` modifier. That, obviously, would kill all the URL parsing. I've made a hotfix(just repeated another hotfix from 2018), but possibly this part can be just rewritten to use strchr/strtok/strcmp or other old-fashioned functions. Here is the hotfix, if any: --- source4/libcli/ldap/ldap_client.c.orig 2020-07-09 13:33:56 +++ source4/libcli/ldap/ldap_client.c @@ -402,8 +402,20 @@ static int ldap_parse_basic_url( *pport = port; return 0; } +#ifdef FREEBSD + int s0, s1; s0 = s1 = 0; + ret = sscanf(url, "%n%*[^:/]%n:%d", &s0, &s1, &port); + if(ret >= 0) { + host = calloc(sizeof(char), s1 - s0 + 1); + if (host == NULL) { + return ENOMEM; + } + ret = sscanf(url, "%[^:/]:%d", host, &port); + } +#else ret = sscanf(url, "%m[^:/]:%d", &host, &port); +#endif if (ret < 1) { return EINVAL; } With best regards, Timur