Wrong string comparison usage

Bug #1859214 reported by Charles Fultz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu MATE
Fix Released
Undecided
Unassigned

Bug Description

There is a bug in the syntax of /etc/profile.d/mate-qt.sh (part of the ubuntu-mate-settings package).

I get the following errors in ~/.xsession-errors on login

/etc/mdm/Xsession: Beginning session setup...
/etc/mdm/Xsession: 2: [: xcustom: unexpected operator
/etc/mdm/Xsession: 2: [: xcustom: unexpected operator
/etc/mdm/Xsession: Setup done, will execute: /usr/bin/ssh-agent -- /homes/foo/.xsession

mate-qt.sh uses "==" for string comparison with test. This is legal with bash, but not with [da]sh. /etc/mdm/Xsession is run with /bin/sh (#!/bin/sh), which sources /etc/profile, which sources /etc/profile.d/mate-qt.sh

*** /etc/profile.d/mate-qt.sh.orig Tue Jan 23 11:50:54 2018
--- /etc/profile.d/mate-qt.sh Fri Jan 10 11:23:04 2020
***************
*** 1,5 ****
  # MATE Desktop Qt integrations
! if [ "x$DESKTOP_SESSION" == "xmate" ] || [ "x$XDG_SESSION_DESKTOP" == "xmate"
]; then
      # QT apps to use GTK styling
      export QT_QPA_PLATFORMTHEME=gtk2
  fi
--- 1,5 ----
  # MATE Desktop Qt integrations
! if [ "x$DESKTOP_SESSION" = "xmate" ] || [ "x$XDG_SESSION_DESKTOP" = "xmate" ];
 then
      # QT apps to use GTK styling
      export QT_QPA_PLATFORMTHEME=gtk2
  fi

Revision history for this message
Martin Wimpress  (flexiondotorg) wrote :

This was fixed via ubuntu-mate-settings 19.10.7 in Ubuntu MATE 19.10.

Changed in ubuntu-mate:
status: New → Fix Released
Revision history for this message
Charles Fultz (cdfultz) wrote :

Is there any plan to back-port it to 18.04 LTS?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.