perl -i.bak -ple 's|(\#include <talloc\.h>)|$1\n#include <time.h>|' lib/param/loadparm.h; perl -i.bak -ple 's|(\#include \"\.\./lib/util/setid\.h\")|$1\n#include <grp\.h>\n#include <uuid/uuid\.h>|' lib/param/loadparm.h; perl -i.bak -ple 's|(\#include \"\.\./lib/util/setid\.h\")|$1\n#include <grp\.h>\n#include <uuid/uuid\.h>|' source3/lib/system_smbd.c; perl -i.bak -ple 's|(\#include \"includes\.h\")|$1\n#include <grp\.h>\n#include <uuid/uuid\.h>|' source4/torture/local/nss_tests.c;
Sorry, I'm being too dumb here but could you be a little more specific about what bugs you're reporting here rather than just a script ? Thanks, Jeremy.
If you compile samba with clang instead of gcc, then many warnings and errors suddenly become evident. The missing headers above cause compilation errors. The patch adds the missing headers.
Great - thanks ! Normally we prefer patches in git format-patch format, but I can also work with this. Thanks for the extra context.
Would it be possible to get the output of the errors? That makes it easier to understand what the actual problem is. Including uuid/uuid.h just looks wrong without knowing the exact reason for it. Including <time.h> should be replaced by "system/time.h" from lib/replace. And <grp.h> should be replaced by "system/passwd.h" from lib/replace. So I guess if some broken system headers require uuid/uuid.h, it should be included in one of the lib/replace/system/*.h files, instead of individual .c files.
I removed the patch and recompiled from fresh sources, to get the original errors. However, something has changed in the underlying system, and I got the following instead. config options: --prefix=${prefix} \ --with-configdir=${etc} \ --with-piddir=${prefix}/var/run \ --mandir=${man} \ --docdir=${doc} \ --with-pie \ --with-libiconv=${foot}/share/libiconv \ --without-ldap \ --without-ads \ --disable-cups --disable-iprint \ --without-winbind \ --without-ntvfs-fileserver \ --without-gettext \ --without-systemd \ --without-acl-support \ --fatal-errors Notes on the tools: clang 3.8.0 gnutls: stable 3.4.14 libiconv 1.14 [ 137/3582] Compiling IDL librpc/idl/auth.idl /Volumes/home/opt/src/samba-4.4.5/librpc/idl/auth.idl:112: warning: helper() is pidl-specific and deprecated. Use `include' instead /Volumes/home/opt/src/samba-4.4.5/librpc/idl/auth.idl:104: error: Unable to determine origin of type `struct cli_credentials' /Volumes/home/opt/src/samba-4.4.5/librpc/idl/auth.idl:104: error: Unable to determine origin of type `struct cli_credentials' [ 215/3582] Compiling IDL librpc/idl/winbind.idl /Volumes/home/opt/src/samba-4.4.5/librpc/idl/winbind.idl:183: warning: [out] argument `validation' not a pointer /Volumes/home/opt/src/samba-4.4.5/librpc/idl/winbind.idl:185: warning: [out] argument `authoritative' not a pointer /Volumes/home/opt/src/samba-4.4.5/librpc/idl/winbind.idl:183: error: winbind_SamLogon: [out] argument 'validation' is not a pointer or array, skip client functions [ 216/3582] Compiling IDL source4/librpc/idl/irpc.idl /Volumes/home/opt/src/samba-4.4.5/source4/librpc/idl/irpc.idl:28: warning: subcontext() is deprecated. Use represent_as() or transmit_as() instead /Volumes/home/opt/src/samba-4.4.5/source4/librpc/idl/irpc.idl:70: warning: [out] argument `info' not a pointer /Volumes/home/opt/src/samba-4.4.5/source4/librpc/idl/irpc.idl:83: warning: top-level [out] pointer `dcname' is not a [ref] pointer /Volumes/home/opt/src/samba-4.4.5/source4/librpc/idl/irpc.idl:91: warning: [out] argument `num_addrs' not a pointer /Volumes/home/opt/src/samba-4.4.5/source4/librpc/idl/irpc.idl:113: warning: [out] argument `generic_reply' not a pointer /Volumes/home/opt/src/samba-4.4.5/source4/librpc/idl/irpc.idl:159: warning: [out] argument `info' not a pointer /Volumes/home/opt/src/samba-4.4.5/source4/librpc/idl/irpc.idl:70: error: nbtd_information: [out] argument 'info' is not a pointer or array, skip client functions /Volumes/home/opt/src/samba-4.4.5/source4/librpc/idl/irpc.idl:83: error: nbtd_getdcname: [out] argument 'dcname' is a pointer to type 'string', skip client functions /Volumes/home/opt/src/samba-4.4.5/source4/librpc/idl/irpc.idl:91: error: nbtd_proxy_wins_challenge: [out] argument 'num_addrs' is not a pointer or array, skip client functions /Volumes/home/opt/src/samba-4.4.5/source4/librpc/idl/irpc.idl:113: error: kdc_check_generic_kerberos: [out] argument 'generic_reply' is not a pointer or array, skip client functions /Volumes/home/opt/src/samba-4.4.5/source4/librpc/idl/irpc.idl:159: error: smbsrv_information: [out] argument 'info' is not a pointer or array, skip client functions [ 573/3582] Compiling lib/addns/dnsrecord.c In file included from ../lib/addns/dnsrecord.c:24: In file included from ../lib/addns/dns.h:31: In file included from ../lib/replace/system/gssapi.h:47: ../source4/heimdal/lib/gssapi/gssapi/gssapi_spnego.h:41:1: fatal error: unknown type name 'GSSAPI_CPP_START' GSSAPI_CPP_START ^ 1 error generated. Waf: Leaving directory `/Volumes/home/opt/src/samba-4.4.5/bin' Build failed: -> task failed (err #1): {task: cc dnsrecord.c -> dnsrecord_1.o} make: *** [all] Error 1
*** Bug 12146 has been marked as a duplicate of this bug. ***
The option "--with-system-mitkrb5" returns the following ERROR: MIT krb5 build requires at least 1.9.0. Kerberos 5 release 1.7-prerelease is found and cannot be used ERROR: You may try to build with embedded Heimdal Kerebros by not specifying --with-system-mitkrb5 " Compiling without the above option returns the following [ 573/3582] Compiling lib/addns/dnsrecord.c In file included from ../lib/addns/dnsrecord.c:24: In file included from ../lib/addns/dns.h:31: In file included from ../lib/replace/system/gssapi.h:47: ../source4/heimdal/lib/gssapi/gssapi/gssapi_spnego.h:41:1: fatal error: unknown type name 'GSSAPI_CPP_START' GSSAPI_CPP_START ^ 1 error generated. Waf: Leaving directory `/Volumes/home/opt/src/samba-4.4.5/bin' Build failed: -> task failed (err #1): {task: cc dnsrecord.c -> dnsrecord_1.o} make: *** [all] Error 1
*** Bug 12148 has been marked as a duplicate of this bug. ***
*** Bug 12147 has been marked as a duplicate of this bug. ***
*** Bug 11974 has been marked as a duplicate of this bug. ***
*** Bug 11973 has been marked as a duplicate of this bug. ***
*** Bug 11972 has been marked as a duplicate of this bug. ***
*** Bug 11971 has been marked as a duplicate of this bug. ***
*** Bug 11970 has been marked as a duplicate of this bug. ***
*** Bug 11969 has been marked as a duplicate of this bug. ***
Update samba 4.5.1 clang 3.9.0 heimdal 1.6rc2_1 configuration: --prefix=${prefix} \ --with-configdir=${etc} \ --with-piddir=${prefix}/var/run \ --mandir=${man} \ --docdir=${doc} \ --with-pie \ --with-libiconv=${foot}/share/libiconv \ --with-pam \ --without-acl-support \ --without-ad-dc \ --without-ads \ --disable-avahi \ --disable-cups \ --without-dnsupdate \ --without-gettext \ --disable-glusterfs \ --disable-iprint \ --without-ldap \ --without-ntvfs-fileserver \ --without-quotas \ --without-systemd \ --without-winbind \ --with-system-mitkrb5 /usr/local/opt/heimdal \ --fatal-errors compiler error: ... symlink: rpc/dcerpc.py -> python/samba/dcerpc/__init__.py Selected embedded Heimdal build ERROR: Target 'roken' in directory /Volumes/home/opt/src/samba-4.5.1/source4/heimdal_build re-defined as LIBRARY - was SYSLIB
Created attachment 12718 [details] Samba compile bug on FreeBSD 11.0-p1 This bug happens in Samba 11.0-p1. This bug also happens on samba version 4.4 and 4.3. It does not happen with Samba 4.2. See attached file for complete compile error message. uname -a FreeBSD saturn 11.0-RELEASE-p1 FreeBSD 11.0-RELEASE-p1 #0 r306420: Thu Sep 29 01:43:23 UTC 2016 root@releng2.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64
Present situation with new samba-4.5.3. config_options="--prefix=${prefix} \ --with-configdir=${etc} \ --with-piddir=${prefix}/var/run \ --mandir=${man} \ --docdir=${doc} \ --with-pie \ --with-libiconv=${foot}/share/libiconv \ --with-pam \ \ --without-acl-support \ --without-ad-dc \ --without-ads \ --disable-avahi \ --disable-cups \ --without-dnsupdate \ --without-gettext \ --disable-glusterfs \ --disable-iprint \ --without-ldap \ --without-ntvfs-fileserver \ --without-quotas \ --without-systemd \ --without-winbind \ \ --fatal-errors"; Please see the attached log for compilation warnings and errors.
Created attachment 12777 [details] compiler warnings and errors
Problem solved on samba 4.6.0