Wrong string comparison usage

Bug #1859214 reported by Charles Fultz on 2020-01-10
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu MATE
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

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

Other bug subscribers