/usr/bin/lightdm-gtk-greeter-settings-pkexec: 7: /usr/bin/lightdm-gtk-greeter-settings-pkexec: [[: not found

Bug #1613967 reported by Stéphane Gourichon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
LightDM GTK Greeter Settings
Fix Released
Undecided
Unassigned
lightdm-gtk-greeter-settings (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

# Context

Running xfce4-settings-manager as user from a terminal to set gtk-greeter parameters.

## Expected

No output in terminal.

## Observed

This output in terminal:

/usr/bin/lightdm-gtk-greeter-settings-pkexec: 7: /usr/bin/lightdm-gtk-greeter-settings-pkexec: [[: not found
/usr/bin/lightdm-gtk-greeter-settings-pkexec: 7: /usr/bin/lightdm-gtk-greeter-settings-pkexec: [[: not found

/usr/bin/lightdm-gtk-greeter-settings-pkexec
uses bash-specific syntax but calls /bin/sh which enables sh-only mode.

In practice it means that special handling of "-s=" and "--socket-id=" arguments is not performed.

I don't know if this may be the sign of more bugs.

The script itself is very short, here it is:

#!/bin/sh

APP_PATH="/usr/bin/lightdm-gtk-greeter-settings"

# Check for "socket" argument
for i in "$@"; do
  if [[ "$i" == "-s="* ]] || [[ "$i" == "--socket-id="* ]]; then
    pkexec "${APP_PATH}" "$@" || "${APP_PATH}" "$@"
    exit $?
  fi
done

pkexec "${APP_PATH}" "$@"

Thank you for your attention.

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: lightdm-gtk-greeter-settings 1.2.1-0ubuntu1
ProcVersionSignature: Ubuntu 4.4.0-34.53-generic 4.4.15
Uname: Linux 4.4.0-34-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.1
Architecture: amd64
CurrentDesktop: XFCE
Date: Wed Aug 17 08:15:22 2016
InstallationDate: Installed on 2016-07-05 (42 days ago)
InstallationMedia: Xubuntu 16.04 LTS "Xenial Xerus" - Release amd64 (20160420.1)
PackageArchitecture: all
SourcePackage: lightdm-gtk-greeter-settings
UpgradeStatus: No upgrade log present (probably fresh install)

Related branches

Revision history for this message
Stéphane Gourichon (stephane-gourichon-lpad) wrote :
Revision history for this message
James Lu (tacocat) wrote :

Confirming this on 1.2.1-1. If I run lightdm-gtk-greeter-settings-pkexec with -s anything as an argument, the shell script errors. Otherwise the program starts fine.

Changed in lightdm-gtk-greeter-settings (Ubuntu):
status: New → Confirmed
Changed in lightdm-gtk-greeter-settings (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lightdm-gtk-greeter-settings - 1.2.1-2

---------------
lightdm-gtk-greeter-settings (1.2.1-2) unstable; urgency=medium

  * Add patch fix-pkexec-shebang.patch to work around bashism in
    lightdm-gtk-greeter-settings-pkexec causing a crash if -s is given
    (LP: #1613967)

 -- James Lu <email address hidden> Sun, 11 Dec 2016 13:51:21 -0800

Changed in lightdm-gtk-greeter-settings (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Sean Davis (bluesabre) wrote :
Changed in lightdm-gtk-greeter-settings:
status: New → Fix Committed
Sean Davis (bluesabre)
Changed in lightdm-gtk-greeter-settings:
milestone: none → 1.2.2
status: Fix Committed → Fix Released
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.