Bug 13437 - Fix building Samba with gcc 8.1
Summary: Fix building Samba with gcc 8.1
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Build (show other bugs)
Version: 4.8.1
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on: 12851
Blocks:
  Show dependency treegraph
 
Reported: 2018-05-15 15:40 UTC by Andreas Schneider
Modified: 2018-07-26 04:27 UTC (History)
3 users (show)

See Also:


Attachments
patch for 4.8 (31.40 KB, patch)
2018-05-23 12:54 UTC, Andreas Schneider
gd: review+
Details
patch for 4.8 (31.22 KB, patch)
2018-05-24 14:54 UTC, Andreas Schneider
gd: review+
Details
patch for 4.7 (28.72 KB, patch)
2018-06-13 16:07 UTC, Andreas Schneider
gd: review+
Details
additional patch for heimdal (2.94 KB, patch)
2018-06-14 14:35 UTC, Guenther Deschner
asn: review+
Details
revised version of patch for 4.7 (28.72 KB, patch)
2018-06-19 14:36 UTC, Guenther Deschner
no flags Details
additional patch for 4.8 (5.50 KB, patch)
2018-06-21 05:18 UTC, Andreas Schneider
gd: review+
Details
full patchset for 4.7 (34.23 KB, patch)
2018-06-21 05:21 UTC, Andreas Schneider
no flags Details
full patchset for 4.7 (35.66 KB, patch)
2018-06-21 09:53 UTC, Andreas Schneider
asn: review? (gd)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Schneider 2018-05-15 15:40:03 UTC
Fix building Samba with gcc 8.1.

Patchset will follow.
Comment 1 Andreas Schneider 2018-05-23 12:54:08 UTC
Created attachment 14214 [details]
patch for 4.8
Comment 2 Guenther Deschner 2018-05-23 13:07:48 UTC
Karolin, please add to 4.8.

Thanks!
Comment 3 Karolin Seeger 2018-05-24 08:41:39 UTC
Patch does not apply on current v4-8-test.
Re-assigning to Andreas.
Comment 4 Andreas Schneider 2018-05-24 10:48:01 UTC
I generated it from the v4-8-test tree:

$ git w
## v4-8-test...origin/v4-8-test [ahead 14]

However, I've just tested the attached patch from this bug and it applies fine here:

git w
## v4-8-test...origin/v4-8-test [ahead 14]
$ git co -b v4-8-test-gcc8 origin/v4-8-test                                                                        
Branch 'v4-8-test-gcc8' set up to track remote branch 'v4-8-test' from 'origin'.
Switched to a new branch 'v4-8-test-gcc8'
$ git am3 ~/Downloads/p/v4-8-test.patch1.txt
Applying: s3-winbindd: use fill_domain_username_talloc() in winbind.
Applying: s3-winbindd: remove unused fill_domain_username()
Applying: s3-printing: fix format-truncation in print_queue_update()
Applying: s4-torture: fix format-truncation warning in smb2 session tests.
Applying: s3-utils: fix format-truncation in smbpasswd
Applying: lib:util: Fix string check in mkdir_p()
Applying: s4:torture: Use strlcpy() in gen_name()
Applying: s3:lib: Use memcpy() in escape_ldap_string()
Applying: s3:passdb: Fix size of ascii_p16
Applying: s3:winbind: Fix uninitialzed variable warning
Applying: lib:util: Fix parameter aliasing in tfork test
Applying: lib:util: Fix size types in debug.c
Applying: s4:ntvfs: Fix string copy of share_name
Applying: lib: Fix array size in audit_logging


What error did you get exactly?
Comment 5 Karolin Seeger 2018-05-24 10:54:17 UTC
user@host:/data/git/samba/v4-8-test$ git am v4-8-test.patch1.txt
Wende an: s3-winbindd: use fill_domain_username_talloc() in winbind.
Wende an: s3-winbindd: remove unused fill_domain_username()
error: Anwendung des Patches fehlgeschlagen: source3/winbindd/winbindd_proto.h:480
error: source3/winbindd/winbindd_proto.h: Patch konnte nicht angewendet werden
Anwendung des Patches fehlgeschlagen bei 0002 s3-winbindd: remove unused fill_domain_username()

But I pulled some other patches meanwhile, maybe it conflicts with the UPN patches. Waiting for Autobuild.
Comment 6 Andreas Schneider 2018-05-24 11:14:49 UTC
Ok, then I will wait for the autobuild and redo the patchset. And yes, I guess it conflicts with the UPN fixes.
Comment 7 Andreas Schneider 2018-05-24 14:54:05 UTC
Created attachment 14216 [details]
patch for 4.8
Comment 8 Guenther Deschner 2018-06-07 14:44:56 UTC
Comment on attachment 14216 [details]
patch for 4.8

LGTM but I found one more buildissue when building with heimdal
Comment 9 Andreas Schneider 2018-06-13 16:07:19 UTC
Created attachment 14233 [details]
patch for 4.7
Comment 10 Guenther Deschner 2018-06-14 14:35:13 UTC
Created attachment 14234 [details]
additional patch for heimdal

We need to have this additional patch (for building heimdal) from master as well.
Comment 11 Andreas Schneider 2018-06-14 14:37:47 UTC
Karolin, the heimdal patch is needed for 4.7 and 4.8. The others according to their name.
Comment 12 Karolin Seeger 2018-06-19 10:48:15 UTC
(In reply to Andreas Schneider from comment #11)
Pushed to autobuild-v4-[8,7]-test.
Comment 13 Karolin Seeger 2018-06-19 11:40:07 UTC
(In reply to Karolin Seeger from comment #12)
Seems to break build on v4-7-test.

[3243/4205] Compiling source3/winbindd/wb_getpwsid.c
../source3/winbindd/wb_getpwsid.c: In function ‘wb_getpwsid_queryuser_done’:
../source3/winbindd/wb_getpwsid.c:119:9: error: ‘output_username’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
  strlcpy(pw->pw_name, output_username, sizeof(pw->pw_name));
         ^
cc1: all warnings being treated as errors
Waf: Leaving directory `/memdisk/kseeger/a47/b3212943/samba-o3/bin'
Build failed:  -> task failed (err #1): 
	{task: cc wb_getpwsid.c -> wb_getpwsid_45.o}
make: *** [all] Error 1

Re-assigning to Günther.
Comment 14 Guenther Deschner 2018-06-19 14:36:27 UTC
Created attachment 14244 [details]
revised version of patch for 4.7
Comment 15 Andreas Schneider 2018-06-19 21:36:23 UTC
I think this revealed a bug.

output_username should be set as pwd->pw_name is filled with it.

So the else if branch should be merged with the if (NTSTATUS_IS_OK(status))?
Comment 16 Andreas Schneider 2018-06-21 05:18:16 UTC
Created attachment 14248 [details]
additional patch for 4.8
Comment 17 Andreas Schneider 2018-06-21 05:21:21 UTC
Created attachment 14249 [details]
full patchset for 4.7
Comment 18 Andreas Schneider 2018-06-21 05:22:23 UTC
The additional patch of bug #12851 needs to be applied first.
Comment 19 Andreas Schneider 2018-06-21 09:53:58 UTC
Created attachment 14250 [details]
full patchset for 4.7
Comment 20 Guenther Deschner 2018-06-21 10:03:22 UTC
Comment on attachment 14248 [details]
additional patch for 4.8

LGTM
Comment 21 Guenther Deschner 2018-06-21 10:06:58 UTC
Comment on attachment 14250 [details]
full patchset for 4.7

LGTM
Comment 22 Guenther Deschner 2018-06-21 10:08:10 UTC
Karolin, please add to 4.7 and 4.8. Thanks!
Comment 23 Karolin Seeger 2018-06-25 19:48:41 UTC
Pushed additional patch to autobuild-v4-8-test.
Comment 24 Karolin Seeger 2018-06-27 08:34:35 UTC
(In reply to Andreas Schneider from comment #17)
Pushed to autobuild-v4-7-test.
Comment 25 Karolin Seeger 2018-07-26 04:27:22 UTC
Pushed to both branches.
Closing out bug report.

Thanks!