xserver: Branch 'master' - 4 commits

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Aug 18 13:54:12 UTC 2021


 Xext/xselinux_ext.c        |   14 +++++++-------
 Xext/xselinux_hooks.c      |   10 +++++-----
 Xext/xselinux_label.c      |   10 +++++-----
 Xext/xselinuxint.h         |    2 +-
 Xi/xichangehierarchy.h     |    2 +-
 hw/dmx/config/dmxconfig.c  |    1 -
 hw/dmx/config/xdmxconfig.c |    1 -
 xkb/xkbtext.c              |    1 +
 8 files changed, 20 insertions(+), 21 deletions(-)

New commits:
commit 1f720dc9a319bb66e2f5f28568614e81aa9e9e4d
Author: Adam Jackson <ajax at redhat.com>
Date:   Tue Aug 17 16:06:57 2021 -0400

    dmx: Fix some redeclaration warnings from gcc 11
    
    Of the form:
    
        ../hw/dmx/config/xdmxconfig.c:68:26: warning: redundant redeclaration of ‘dmxConfigEntry’ [-Wredundant-decls]
           68 | extern DMXConfigEntryPtr dmxConfigEntry;
              |                          ^~~~~~~~~~~~~~

diff --git a/hw/dmx/config/dmxconfig.c b/hw/dmx/config/dmxconfig.c
index 5daf9ec9c..3b9475046 100644
--- a/hw/dmx/config/dmxconfig.c
+++ b/hw/dmx/config/dmxconfig.c
@@ -72,7 +72,6 @@ typedef struct DMXConfigCmdStruct {
     DMXConfigList *xinputs;
 } DMXConfigCmd, *DMXConfigCmdPtr;
 
-extern DMXConfigEntryPtr dmxConfigEntry;
 static DMXConfigCmd dmxConfigCmd;
 
 static int dmxDisplaysFromCommandLine;
diff --git a/hw/dmx/config/xdmxconfig.c b/hw/dmx/config/xdmxconfig.c
index 05d839688..8cb861c74 100644
--- a/hw/dmx/config/xdmxconfig.c
+++ b/hw/dmx/config/xdmxconfig.c
@@ -65,7 +65,6 @@ extern FILE *yyin;
 #define DMX_CANVAS_WIDTH  400
 #define DMX_CANVAS_HEIGHT 500
 
-extern DMXConfigEntryPtr dmxConfigEntry;
 static DMXConfigVirtualPtr dmxConfigCurrent, dmxConfigNewVirtual;
 static DMXConfigDisplayPtr dmxConfigCurrentDisplay, dmxConfigNewDisplay;
 static int dmxConfigGrabbed, dmxConfigGrabbedFine;
commit b49f0f9b323d66056aa9cd88f9ca1a124037bf32
Author: Adam Jackson <ajax at redhat.com>
Date:   Tue Aug 17 16:04:40 2021 -0400

    xkb: Silence a warning from gcc 11
    
    I get this:
    
        In function ‘TryCopyStr’,
            inlined from ‘CopyISOLockArgs’ at ../xkb/xkbtext.c:875:9:
        ../xkb/xkbtext.c:720:13: warning: ‘tbuf’ may be used uninitialized [-Wmaybe-uninitialized]
          720 |             strcat(to, from);
              |             ^~~~~~~~~~~~~~~~
        ../xkb/xkbtext.c: In function ‘CopyISOLockArgs’:
        <built-in>: note: by argument 1 of type ‘const char *’ to ‘__builtin_strlen’ declared here
        ../xkb/xkbtext.c:871:10: note: ‘tbuf’ declared here
          871 |     char tbuf[64];
              |          ^~~~
    
    Just initialize tbuf so it definitely works.

diff --git a/xkb/xkbtext.c b/xkb/xkbtext.c
index d2a2567fc..00a26c576 100644
--- a/xkb/xkbtext.c
+++ b/xkb/xkbtext.c
@@ -870,6 +870,7 @@ CopyISOLockArgs(XkbDescPtr xkb, XkbAction *action, char *buf, int *sz)
     XkbISOAction *act;
     char tbuf[64];
 
+    memset(tbuf, 0, sizeof(tbuf));
     act = &action->iso;
     if (act->flags & XkbSA_ISODfltIsGroup) {
         TryCopyStr(tbuf, "group=", sz);
commit c1138d8ec8d029de54261e355c0e5da0b001044a
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Jul 9 15:30:16 2021 -0400

    xinput: Silence a warning from gcc 11
    
    [45/388] Compiling C object Xi/liblibxserver_xi.a.p/xichangehierarchy.c.o
    ../Xi/xichangehierarchy.c:61:32: warning: argument 1 of type ‘int[256]’ with mismatched bound [-Warray-parameter=]
       61 | XISendDeviceHierarchyEvent(int flags[MAXDEVICES])
          |                            ~~~~^~~~~~~~~~~~~~~~~
    In file included from ../Xi/xichangehierarchy.c:54:
    ../Xi/xichangehierarchy.h:42:37: note: previously declared as ‘int[]’
       42 | void XISendDeviceHierarchyEvent(int flags[]);
          |                                 ~~~~^~~~~~~

diff --git a/Xi/xichangehierarchy.h b/Xi/xichangehierarchy.h
index 8ec1915ae..649b654e5 100644
--- a/Xi/xichangehierarchy.h
+++ b/Xi/xichangehierarchy.h
@@ -39,6 +39,6 @@
 int SProcXIChangeHierarchy(ClientPtr /* client */ );
 int ProcXIChangeHierarchy(ClientPtr /* client */ );
 
-void XISendDeviceHierarchyEvent(int flags[]);
+void XISendDeviceHierarchyEvent(int flags[MAXDEVICES]);
 
 #endif                          /* CHDEVHIER_H */
commit f3a98334e6a56858853f3894b0f48ee040741410
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Jul 9 15:26:47 2021 -0400

    selinux: Stop using security_context_t
    
    This is apparently deprecated now and is and was always just char *.

diff --git a/Xext/xselinux_ext.c b/Xext/xselinux_ext.c
index 5007b442e..99501eeef 100644
--- a/Xext/xselinux_ext.c
+++ b/Xext/xselinux_ext.c
@@ -37,8 +37,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #define USE_SEL offsetof(SELinuxSubjectRec, sel_use_sid)
 
 typedef struct {
-    security_context_t octx;
-    security_context_t dctx;
+    char *octx;
+    char *dctx;
     CARD32 octx_len;
     CARD32 dctx_len;
     CARD32 id;
@@ -48,10 +48,10 @@ typedef struct {
  * Extension Dispatch
  */
 
-static security_context_t
+static char *
 SELinuxCopyContext(char *ptr, unsigned len)
 {
-    security_context_t copy = malloc(len + 1);
+    char *copy = malloc(len + 1);
 
     if (!copy)
         return NULL;
@@ -84,7 +84,7 @@ static int
 SELinuxSendContextReply(ClientPtr client, security_id_t sid)
 {
     SELinuxGetContextReply rep;
-    security_context_t ctx = NULL;
+    char *ctx = NULL;
     int len = 0;
 
     if (sid) {
@@ -117,7 +117,7 @@ ProcSELinuxSetCreateContext(ClientPtr client, unsigned offset)
 {
     PrivateRec **privPtr = &client->devPrivates;
     security_id_t *pSid;
-    security_context_t ctx = NULL;
+    char *ctx = NULL;
     char *ptr;
     int rc;
 
@@ -165,7 +165,7 @@ ProcSELinuxGetCreateContext(ClientPtr client, unsigned offset)
 static int
 ProcSELinuxSetDeviceContext(ClientPtr client)
 {
-    security_context_t ctx;
+    char *ctx;
     security_id_t sid;
     DeviceIntPtr dev;
     SELinuxSubjectRec *subj;
diff --git a/Xext/xselinux_hooks.c b/Xext/xselinux_hooks.c
index 2d85928f5..57b24e452 100644
--- a/Xext/xselinux_hooks.c
+++ b/Xext/xselinux_hooks.c
@@ -114,7 +114,7 @@ SELinuxLabelClient(ClientPtr client)
     int fd = XaceGetConnectionNumber(client);
     SELinuxSubjectRec *subj;
     SELinuxObjectRec *obj;
-    security_context_t ctx;
+    char *ctx;
 
     subj = dixLookupPrivate(&client->devPrivates, subjectKey);
     obj = dixLookupPrivate(&client->devPrivates, objectKey);
@@ -169,7 +169,7 @@ SELinuxLabelInitial(void)
     XaceScreenAccessRec srec;
     SELinuxSubjectRec *subj;
     SELinuxObjectRec *obj;
-    security_context_t ctx;
+    char *ctx;
     void *unused;
 
     /* Do the serverClient */
@@ -773,7 +773,7 @@ SELinuxResourceState(CallbackListPtr *pcbl, void *unused, void *calldata)
     subj = dixLookupPrivate(&wClient(pWin)->devPrivates, subjectKey);
 
     if (subj->sid) {
-        security_context_t ctx;
+        char *ctx;
         int rc = avc_sid_to_context_raw(subj->sid, &ctx);
 
         if (rc < 0)
@@ -791,7 +791,7 @@ SELinuxResourceState(CallbackListPtr *pcbl, void *unused, void *calldata)
     obj = dixLookupPrivate(&pWin->devPrivates, objectKey);
 
     if (obj->sid) {
-        security_context_t ctx;
+        char *ctx;
         int rc = avc_sid_to_context_raw(obj->sid, &ctx);
 
         if (rc < 0)
@@ -847,7 +847,7 @@ void
 SELinuxFlaskInit(void)
 {
     struct selinux_opt avc_option = { AVC_OPT_SETENFORCE, (char *) 0 };
-    security_context_t ctx;
+    char *ctx;
     int ret = TRUE;
 
     switch (selinuxEnforcingState) {
diff --git a/Xext/xselinux_label.c b/Xext/xselinux_label.c
index 8559385b9..48414d88a 100644
--- a/Xext/xselinux_label.c
+++ b/Xext/xselinux_label.c
@@ -97,7 +97,7 @@ static int
 SELinuxAtomToSIDLookup(Atom atom, SELinuxObjectRec * obj, int map, int polymap)
 {
     const char *name = NameForAtom(atom);
-    security_context_t ctx;
+    char *ctx;
     int rc = Success;
 
     obj->poly = 1;
@@ -255,7 +255,7 @@ SELinuxEventToSID(unsigned type, security_id_t sid_of_window,
 {
     const char *name = LookupEventName(type);
     security_id_t sid;
-    security_context_t ctx;
+    char *ctx;
 
     type &= 127;
 
@@ -291,7 +291,7 @@ SELinuxEventToSID(unsigned type, security_id_t sid_of_window,
 int
 SELinuxExtensionToSID(const char *name, security_id_t * sid_rtn)
 {
-    security_context_t ctx;
+    char *ctx;
 
     /* Look in the mappings of extension names to contexts */
     if (selabel_lookup_raw(label_hnd, &ctx, name, SELABEL_X_EXT) < 0) {
@@ -347,10 +347,10 @@ SELinuxTypeToClass(RESTYPE type)
     return (security_class_t) (unsigned long) tmp;
 }
 
-security_context_t
+char *
 SELinuxDefaultClientLabel(void)
 {
-    security_context_t ctx;
+    char *ctx;
 
     if (selabel_lookup_raw(label_hnd, &ctx, "remote", SELABEL_X_CLIENT) < 0)
         FatalError("SELinux: failed to look up remote-client context\n");
diff --git a/Xext/xselinuxint.h b/Xext/xselinuxint.h
index 57f8b7305..5a5874075 100644
--- a/Xext/xselinuxint.h
+++ b/Xext/xselinuxint.h
@@ -99,7 +99,7 @@ int
 
 security_class_t SELinuxTypeToClass(RESTYPE type);
 
-security_context_t SELinuxDefaultClientLabel(void);
+char *SELinuxDefaultClientLabel(void);
 
 void
  SELinuxLabelInit(void);


More information about the xorg-commit mailing list