config-error-dialog.sh should pass --no-markup

Bug #1887252 reported by Mikel Ward
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
gdm3 (Ubuntu)
Fix Released
Low
Gunnar Hjalmarsson
lightdm (Ubuntu)
Fix Released
Low
Gunnar Hjalmarsson

Bug Description

I modified my ~/.profile to call "logger". This resulted in in producing some output on stderr like

```
<13>Jul 11 13:02:46 /usr/sbin/lightdm-session[1408]: profile sourced ...
```

This showed an empty zenity prompt.

Logs suggest zenity was failing because it was treating `<13>` as pango markup.

```
 from markup due to error parsing markup: Error on line 3 char 6: “13” is not a valid
```

We should not assume the error message strings contain valid markup, since their source is unknown.

Tags: jammy lunar
Mikel Ward (mikelward)
affects: gdm (Ubuntu) → lightdm (Ubuntu)
Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

Thanks for your report. Using the --no-markup option sounds reasonable to me.

Changed in gdm3 (Ubuntu):
assignee: nobody → Gunnar Hjalmarsson (gunnarhj)
importance: Undecided → Low
status: New → In Progress
Changed in lightdm (Ubuntu):
assignee: nobody → Gunnar Hjalmarsson (gunnarhj)
importance: Undecided → Low
status: New → In Progress
Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

Second thoughts...

The --no-markup option prevents zenity from interpreting \n which makes the dialog hard to read in most cases. So only adding --no-markup is not a viable solution.

As a possible alternative I played with sed() a bit. The script includes this line:

TEXT="$PARA1\n\n$(fold -s $ERR)\n\n$PARA2"

My thought is to add a new line right after that. Something along these lines:

TEXT=$(printf '%s' "$TEXT" | sed 's/</\&lt;/g')

which would replace all occurrences of '<' with '&lt;'. Can you please test that and see if it helps in your case.

Changed in gdm3 (Ubuntu):
status: In Progress → Incomplete
Changed in lightdm (Ubuntu):
status: In Progress → Incomplete
summary: - lightdm config-error-dialog.sh should pass --no-markup
+ config-error-dialog.sh should pass --no-markup
tags: added: jammy lunar
Revision history for this message
Hongyi Zhao (hongyi-zhao) wrote : Re: [Bug 1887252] Re: config-error-dialog.sh should pass --no-markup

On Tue, Feb 7, 2023 at 10:45 AM Daniel van Vugt
<email address hidden> wrote:
>
> ** Tags added: jammy lunar
>
> --
> You received this bug notification because you are subscribed to a
> duplicate bug report (2005135).
> https://bugs.launchpad.net/bugs/1887252
>
> Title:
> config-error-dialog.sh should pass --no-markup
>
> Status in gdm3 package in Ubuntu:
> Incomplete
> Status in lightdm package in Ubuntu:
> Incomplete
>
> Bug description:
> I modified my ~/.profile to call "logger". This resulted in in
> producing some output on stderr like
>
> ```
> <13>Jul 11 13:02:46 /usr/sbin/lightdm-session[1408]: profile sourced ...
> ```
>
> This showed an empty zenity prompt.
>
> Logs suggest zenity was failing because it was treating `<13>` as
> pango markup.
>
> ```
> from markup due to error parsing markup: Error on line 3 char 6: “13” is not a valid
> ```
>
> We should not assume the error message strings contain valid markup,
> since their source is unknown.

So, what should be the appropriate bug fix method in this scenario?

> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/gdm3/+bug/1887252/+subscriptions

Best,
Zhao

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

@Hongyi Zhao: As you wrote in the duplicate bug, my simplistic code in comment #2, which only escapes the '<' character, would not be sufficient. At the same time the issue I mentioned, about --no-markup making \n being displayed literally instead of interpreted as a newline, still stands.

Probably this variant would do it:

TEXT=$(printf '%s' "$TEXT" | sed 's/&/\&amp;/g;
                                  s/</\&lt;/g;
                                  s/>/\&gt;/g;
                                  s/"/\&quot;/g;
                                  s/'"'"'/\&#39;/g')

But before making the change, I would appreciate some feedback from you or others that that addition to /etc/gdm3/config-error-dialog.sh would address the issues you have observed.

Revision history for this message
Hongyi Zhao (hongyi-zhao) wrote :

On Wed, Feb 8, 2023 at 9:15 AM Gunnar Hjalmarsson
<email address hidden> wrote:
>
> @Hongyi Zhao: As you wrote in the duplicate bug, my simplistic code in
> comment #2, which only escapes the '<' character, would not be
> sufficient. At the same time the issue I mentioned, about --no-markup
> making \n being displayed literally instead of interpreted as a newline,
> still stands.
>
> Probably this variant would do it:
>
> TEXT=$(printf '%s' "$TEXT" | sed 's/&/\&amp;/g;
> s/</\&lt;/g;
> s/>/\&gt;/g;
> s/"/\&quot;/g;
> s/'"'"'/\&#39;/g')
>
> But before making the change, I would appreciate some feedback from you
> or others that that addition to /etc/gdm3/config-error-dialog.sh would
> address the issues you have observed.

Please see the comments given by Sebastian Keller here [1].

[1] https://discourse.gnome.org/t/are-you-sure-you-want-to-proceed-message-on-login/13758/13

Best,
Zhao

> --
> You received this bug notification because you are subscribed to a
> duplicate bug report (2005135).
> https://bugs.launchpad.net/bugs/1887252
>
> Title:
> config-error-dialog.sh should pass --no-markup
>
> Status in gdm3 package in Ubuntu:
> Incomplete
> Status in lightdm package in Ubuntu:
> Incomplete
>
> Bug description:
> I modified my ~/.profile to call "logger". This resulted in in
> producing some output on stderr like
>
> ```
> <13>Jul 11 13:02:46 /usr/sbin/lightdm-session[1408]: profile sourced ...
> ```
>
> This showed an empty zenity prompt.
>
> Logs suggest zenity was failing because it was treating `<13>` as
> pango markup.
>
> ```
> from markup due to error parsing markup: Error on line 3 char 6: “13” is not a valid
> ```
>
> We should not assume the error message strings contain valid markup,
> since their source is unknown.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/gdm3/+bug/1887252/+subscriptions
>

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

That looks like a better solution indeed, and I think I have got enough of evidence that we should go for Sebastian's suggestion.

( Why didn't you mention that upstream discussion in your bug? ;) )

Thanks for your persistence! I'll make that change soon.

Changed in gdm3 (Ubuntu):
status: Incomplete → In Progress
Changed in lightdm (Ubuntu):
status: Incomplete → In Progress
Revision history for this message
Hongyi Zhao (hongyi-zhao) wrote :

On Wed, Feb 8, 2023 at 10:25 AM Gunnar Hjalmarsson
<email address hidden> wrote:
>
> That looks like a better solution indeed, and I think I have got enough
> of evidence that we should go for Sebastian's suggestion.
>
> ( Why didn't you mention that upstream discussion in your bug? ;) )

That should be my negligence. I only gave a link for reference from
discourse.gnome.org to bugs.launchpad.net [1] but did not provide the
opposite link on bugs.launchpad.net pointing to discourse.gnome.org,
at that moment.

> Thanks for your persistence! I'll make that change soon.

OK.

> ** Changed in: gdm3 (Ubuntu)
> Status: Incomplete => In Progress
>
> ** Changed in: lightdm (Ubuntu)
> Status: Incomplete => In Progress

[1] https://discourse.gnome.org/t/are-you-sure-you-want-to-proceed-message-on-login/13758/11?u=hongyi-zhao
[2] https://bugs.launchpad.net/ubuntu/+source/gdm3/+bug/2005135

Regards,
Zhao

> --
> You received this bug notification because you are subscribed to a
> duplicate bug report (2005135).
> https://bugs.launchpad.net/bugs/1887252
>
> Title:
> config-error-dialog.sh should pass --no-markup
>
> Status in gdm3 package in Ubuntu:
> In Progress
> Status in lightdm package in Ubuntu:
> In Progress
>
> Bug description:
> I modified my ~/.profile to call "logger". This resulted in in
> producing some output on stderr like
>
> ```
> <13>Jul 11 13:02:46 /usr/sbin/lightdm-session[1408]: profile sourced ...
> ```
>
> This showed an empty zenity prompt.
>
> Logs suggest zenity was failing because it was treating `<13>` as
> pango markup.
>
> ```
> from markup due to error parsing markup: Error on line 3 char 6: “13” is not a valid
> ```
>
> We should not assume the error message strings contain valid markup,
> since their source is unknown.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/gdm3/+bug/1887252/+subscriptions
>

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

Change for gdm3 was pushed to git repo:

https://salsa.debian.org/gnome-team/gdm/-/commit/03d610a4

lightdm has been uploaded with the change.

Changed in gdm3 (Ubuntu):
status: In Progress → Fix Committed
Changed in lightdm (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lightdm - 1.30.0-0ubuntu8

---------------
lightdm (1.30.0-0ubuntu8) lunar; urgency=medium

  * debian/config-error-dialog.sh:
    - Use --no-markup option in zenity call (LP: #1887252)

 -- Gunnar Hjalmarsson <email address hidden> Wed, 08 Feb 2023 22:29:55 +0100

Changed in lightdm (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gdm3 - 43.0-3ubuntu2

---------------
gdm3 (43.0-3ubuntu2) lunar; urgency=medium

  * debian/patches/ubuntu/config_error_dialog.patch:
    - Use --no-markup option in zenity call (LP: #1887252)

 -- Gunnar Hjalmarsson <email address hidden> Wed, 15 Feb 2023 18:41:29 +0100

Changed in gdm3 (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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