Bug 771522

Summary: libselinux patch causes build errors with -Werror=missing-braces
Product: [Fedora] Fedora Reporter: Peter Hutterer <peter.hutterer>
Component: libselinuxAssignee: Daniel Walsh <dwalsh>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-01-04 16:03:51 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
How does this look? none

Description Peter Hutterer 2012-01-03 23:47:22 UTC
libselinux-rhat.patch changes struct selinux_opt from { int, char* } to { int, union { char*, char** }}. This causes code in the following form to fail when -Werror=missing-braces is in the CFLAGS.

  struct selinux_opt selabel_option = { SELABEL_OPT_VALIDATE, (char *)1 };

xselinux_hooks.c: In function 'SELinuxFlaskInit':
xselinux_hooks.c:851:12: error: missing braces around initializer
[-Werror=missing-braces]
xselinux_hooks.c:851:12: error: (near initialization for
'avc_option.<anonymous>') [-Werror=missing-braces]
cc1: some warnings being treated as errors

Example taken from the X server, we just switched to -Werror=missing-braces. 

The hard bit was tracking this down since all the man pages still refer to the old struct form (and I could only trigger the error on koji at first), and my F16 machine has the old struct.

Not sure if you want to do anything about it, but if this is a long-standing patch, updating the man pages would be useful.

Comment 1 Daniel Walsh 2012-01-04 16:01:16 UTC
Created attachment 550708 [details]
How does this look?

Comment 2 Daniel Walsh 2012-01-04 16:03:51 UTC
Fixed in libselinux-2.1.9-2.fc17