<div dir="ltr"><div><div><div>Hi, guys!<br><br></div>I've discussed <a href="https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=215202">https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=215202</a> issue with the iXsystems FreeBSD src committers, they are going to look into that. But even if that(or similar) fix will go into upstream it won't happen very soon. FreeBSD has longer release cycles than Linux, so meanwhile we need to find the workaround.<br><br></div>The relevant part of the failing code should use 'struct xucread' on FreeBSD and 'LOCAL_PEERCRED' option to the getsockopt(2), but as it is already mentioned in the bug report that won't provide you the PID of the remote peer.<br><br></div>I wonder, would it be possible to replace getsockopt(2) here with the sendmsg()/recvmsg() and 'SCM_CREDS' type of message, like described here, for ex:<br><div><br></div><div><a href="https://davejingtian.org/2015/02/17/retrieve-pid-from-the-packet-in-unix-domain-socket-a-complete-use-case-for-recvmsgsendmsg/">https://davejingtian.org/2015/02/17/retrieve-pid-from-the-packet-in-unix-domain-socket-a-complete-use-case-for-recvmsgsendmsg/</a><br><div><div><br></div><div>This seems be less Linux-specific way of obtaining remote peer PID.</div><div><br></div><div>With regards,</div><div>Timur Bakeyev.<br></div><div><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Dec 10, 2017 at 2:47 AM, Andrew Bartlett <span dir="ltr"><<a href="mailto:abartlet@samba.org" target="_blank">abartlet@samba.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Sat, 2017-12-09 at 23:04 +0100, Andreas Beckmann wrote:<br>
> Source: samba<br>
> Version: 2:4.7.3+dfsg-1<br>
> Severity: important<br>
> User: <a href="mailto:debian-bsd@lists.debian.org">debian-bsd@lists.debian.org</a><br>
> Usertags: kfreebsd<br>
><br>
> Hi,<br>
><br>
> that 4.7.x uploads of samba FTBFS on kfreebsd:<br>
<br>
> [2706/4004] Compiling ctdb/tests/src/ipalloc_read_<wbr>known_ips.c<br>
> 08:44:02 runner /usr/bin/gcc -g -O2 -fdebug-prefix-map=/«BUILDDIR»<wbr>/samba-4.7.3+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security -fPIE -fPIC -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DCTDB_HELPER_BINDIR="/usr/<wbr>lib/x86_64-kfreebsd-gnu/ctdb" -DLOGDIR="/var/log/ctdb" -DCTDB_ETCDIR="/etc/ctdb" -DCTDB_VARDIR="/var/lib/ctdb" -DCTDB_RUNDIR="/var/run/ctdb" -fstack-protector -DSTATIC_fake_ctdbd_MODULES=<wbr>NULL -DSTATIC_fake_ctdbd_MODULES_<wbr>PROTO=extern void __fake_ctdbd_dummy_module_<wbr>proto(void) -MD -Wdate-time -D_FORTIFY_SOURCE=2 -Idefault/ctdb -I../ctdb -Idefault/include/public -I../include/public -Idefault/source4 -I../source4 -Idefault/lib -I../lib -Idefault/source4/lib -I../source4/lib -Idefault/source4/include -I../source4/include -Idefault/include -I../include -Idefault/lib/replace -I../lib/replace -Idefault/ctdb/include -I../ctdb/include -Idefault -I.. -Idefault/lib/util/charset -I../lib/util/charset -Idefault/libcli/util -I../libcli/util -Idefault/lib/crypto -I../lib/crypto -Idefault/lib/async_req -I../lib/async_req -Idefault/dynconfig -I../dynconfig -I/usr/local/include -D_SAMBA_BUILD_=4 -DHAVE_CONFIG_H=1 -D_GNU_SOURCE=1 -D_XOPEN_SOURCE_EXTENDED=1 ../ctdb/tests/src/ipalloc_<wbr>read_known_ips.c -c -o default/ctdb/tests/src/<wbr>ipalloc_read_known_ips_134.o<br>
> ../ctdb/tests/src/fake_ctdbd.<wbr>c: In function 'client_send':<br>
> ../ctdb/tests/src/fake_ctdbd.<wbr>c:3081:15: error: storage size of 'cr' isn't known<br>
>   struct ucred cr;<br>
>                ^~<br>
> ../ctdb/tests/src/fake_ctdbd.<wbr>c:3082:25: error: invalid application of 'sizeof' to incomplete type 'struct ucred'<br>
>   socklen_t crl = sizeof(struct ucred);<br>
>                          ^~~~~~<br>
> ../ctdb/tests/src/fake_ctdbd.<wbr>c:3095:35: error: 'SO_PEERCRED' undeclared (first use in this function); did you mean 'SO_PEERLABEL'?<br>
>   ret = getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &cr, &crl);<br>
>                                    ^~~~~~~~~~~<br>
>                                    SO_PEERLABEL<br>
> ../ctdb/tests/src/fake_ctdbd.<wbr>c:3095:35: note: each undeclared identifier is reported only once for each function it appears in<br>
> [2707/4004] Compiling lib/pthreadpool/tests.c<br>
> 08:44:02 runner /usr/bin/gcc -g -O2 -fdebug-prefix-map=/«BUILDDIR»<wbr>/samba-4.7.3+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security -fPIE -fPIC -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DCTDB_HELPER_BINDIR="/usr/<wbr>lib/x86_64-kfreebsd-gnu/ctdb" -DLOGDIR="/var/log/ctdb" -DCTDB_ETCDIR="/etc/ctdb" -DCTDB_VARDIR="/var/lib/ctdb" -DCTDB_RUNDIR="/var/run/ctdb" -fstack-protector -DSTATIC_pthreadpooltest_<wbr>MODULES=NULL -DSTATIC_pthreadpooltest_<wbr>MODULES_PROTO=extern void __pthreadpooltest_dummy_<wbr>module_proto(void) -MD -Wdate-time -D_FORTIFY_SOURCE=2 -Idefault/lib/pthreadpool -I../lib/pthreadpool -Idefault/include/public -I../include/public -Idefault/source4 -I../source4 -Idefault/lib -I../lib -Idefault/source4/lib -I../source4/lib -Idefault/source4/include -I../source4/include -Idefault/include -I../include -Idefault/lib/replace -I../lib/replace -Idefault/ctdb/include -I../ctdb/include -Idefault/ctdb -I../ctdb -Idefault -I.. -Idefault/libcli/util -I../libcli/util -I/usr/local/include -D_SAMBA_BUILD_=4 -DHAVE_CONFIG_H=1 -D_GNU_SOURCE=1 -D_XOPEN_SOURCE_EXTENDED=1 ../lib/pthreadpool/tests.c -c -o default/lib/pthreadpool/tests_<wbr>2.o<br>
> Waf: Leaving directory `/«BUILDDIR»/samba-4.7.3+dfsg/<wbr>bin'<br>
> Build failed:  -> task failed (err #1):<br>
>       {task: cc fake_ctdbd.c -> fake_ctdbd_134.o}<br>
> debian/rules:102: recipe for target 'override_dh_auto_build' failed<br>
> make[1]: *** [override_dh_auto_build] Error 1<br>
<br>
This was introduced in the fix for<br>
<a href="https://bugzilla.samba.org/show_bug.cgi?id=13012" rel="noreferrer" target="_blank">https://bugzilla.samba.org/<wbr>show_bug.cgi?id=13012</a><br>
<br>
Can you please take up the regression upstream?  There is interest in<br>
fixing FreeBSD, talk to Timur I. Bakeyev (CC'ed) in particular.  <br>
<br>
(There is very strong preference to not carry Debian-specific patches<br>
unless they are already upstream.)<br>
<br>
Lastly however, it looks like what is desired here is simply not<br>
possible:<br>
<br>
<a href="https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=215202" rel="noreferrer" target="_blank">https://bugs.freebsd.org/<wbr>bugzilla/show_bug.cgi?id=<wbr>215202</a><br>
<br>
You may wish to disabled building CTDB on kfreebsd or find a way not to<br>
build the tests.<br>
<br>
Sorry,<br>
<br>
Andrew Bartlett<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Andrew Bartlett                       <a href="http://samba.org/~abartlet/" rel="noreferrer" target="_blank">http://samba.org/~abartlet/</a><br>
Authentication Developer, Samba Team  <a href="http://samba.org" rel="noreferrer" target="_blank">http://samba.org</a><br>
Samba Developer, Catalyst IT          <a href="http://catalyst.net.nz/services/samba" rel="noreferrer" target="_blank">http://catalyst.net.nz/<wbr>services/samba</a><br>
<br>
</font></span></blockquote></div><br></div>