<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>448859</bug_id>
          
          <creation_ts>2022-01-21 00:45:28 +0000</creation_ts>
          <short_desc>KEmailClientLaucherJob can&apos;t lauch Thunderbird with env variable in Exec</short_desc>
          <delta_ts>2022-08-19 06:23:52 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>Frameworks and Libraries</classification>
          <product>frameworks-kio</product>
          <component>general</component>
          <version>git master</version>
          <rep_platform>Other</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Nicolas Fella">nicolas.fella</reporter>
          <assigned_to name="Ahmad Samir">a.samirh78</assigned_to>
          <cc>fabian</cc>
    
    <cc>faure</cc>
    
    <cc>kdelibs-bugs-null</cc>
    
    <cc>nate</cc>
    
    <cc>postix</cc>
          
          <cf_commitlink>https://invent.kde.org/frameworks/kio/commit/4c4f4b919a81706913596e7ba518165dd80c9eb7</cf_commitlink>
          <cf_versionfixedin>5.92</cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2096191</commentid>
    <comment_count>0</comment_count>
    <who name="Nicolas Fella">nicolas.fella</who>
    <bug_when>2022-01-21 00:45:28 +0000</bug_when>
    <thetext>STEPS TO REPRODUCE
1. Change the Exec line in the Thunderbird desktop file to &quot;MOZ_ENABLE_WAYLAND=1 /usr/lib/thunderbird/thunderbird %u&quot; 
2. Set thunderbird as default email client
3. Create and start a KEmailClientLauncherJob

OBSERVED RESULT
Thunderbird does not open

kf.kio.gui: Failed to register new cgroup: &quot;app--a2814818d4114405bc37e453a8dc3eaf.scope&quot; &quot;org.freedesktop.DBus.Error.UnixProcessIdUnknown&quot; &quot;Process with ID 125248 does not exist.&quot;

This is because KIO::DesktopExecParser::executableName trips over the env variable

Removing the env variable makes it work

EXPECTED RESULT
Thunderbird opens

SOFTWARE/OS VERSIONS
KDE Plasma Version: master
KDE Frameworks Version: master
Qt Version: 5.15-kde</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2102472</commentid>
    <comment_count>1</comment_count>
    <who name="Bug Janitor Service">bug-janitor</who>
    <bug_when>2022-02-09 16:31:08 +0000</bug_when>
    <thetext>A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/751</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2107512</commentid>
    <comment_count>2</comment_count>
    <who name="Ahmad Samir">a.samirh78</who>
    <bug_when>2022-02-23 16:12:22 +0000</bug_when>
    <thetext>Git commit 4c4f4b919a81706913596e7ba518165dd80c9eb7 by Ahmad Samir.
Committed on 23/02/2022 at 11:44.
Pushed by ahmadsamir into branch &apos;master&apos;.

DesktopExecParser: parse environment variables too

And add a method that returns a QProcessEnvironment object containing those
environment variables (thanks to Meven for the idea of returning a QPE).

Add unittest.
FIXED_IN: 5.92

M  +33   -0    autotests/krununittest.cpp
M  +2    -0    autotests/krununittest.h
M  +36   -1    src/core/desktopexecparser.cpp
M  +28   -3    src/core/desktopexecparser.h

https://invent.kde.org/frameworks/kio/commit/4c4f4b919a81706913596e7ba518165dd80c9eb7</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2107948</commentid>
    <comment_count>3</comment_count>
    <who name="Fabian Vogt">fabian</who>
    <bug_when>2022-02-25 13:43:49 +0000</bug_when>
    <thetext>I don&apos;t think specifying environment variables like this is valid. The Exec= line must start with the application and must not contain &apos;=&apos;:

https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s07.html

A command line consists of an executable program optionally followed by one or more arguments. The executable program can either be specified with its full path or with the name of the executable only. If no full path is provided the executable is looked up in the $PATH environment variable used by the desktop environment. The name or path of the executable program may not contain the equal sign (&quot;=&quot;). Arguments are separated by a space.

So the previous KIO behaviour was probably correct and the change should be reverted.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2107953</commentid>
    <comment_count>4</comment_count>
    <who name="Nicolas Fella">nicolas.fella</who>
    <bug_when>2022-02-25 13:51:03 +0000</bug_when>
    <thetext>The thing is, launching the app works perfectly fine and sets the env variable, it&apos;s just that executableName behaves differently</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2107956</commentid>
    <comment_count>5</comment_count>
    <who name="Fabian Vogt">fabian</who>
    <bug_when>2022-02-25 13:57:24 +0000</bug_when>
    <thetext>(In reply to Nicolas Fella from comment #4)
&gt; The thing is, launching the app works perfectly fine and sets the env
&gt; variable, it&apos;s just that executableName behaves differently

I&apos;d say that&apos;s a bug - KIO should not accept it at all as it&apos;s invalid. That can cause weird issues and hide compatibility problems.

I wonder how it works at all, it probably ends up in a /bin/sh context at some point.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2109421</commentid>
    <comment_count>6</comment_count>
    <who name="David Faure">faure</who>
    <bug_when>2022-03-04 22:59:19 +0000</bug_when>
    <thetext>Yes this ends up in /bin/sh. I thought any shell command was valid for an Exec line.
Thanks for the pointer to the spec, that&apos;s instructive. Sometimes we voluntarily support more things than the spec, but it&apos;s probably not a great idea (creates compat problems when people test something in KDE and assume it&apos;ll work everywhere)

I just found desktop files that say

Exec=env WINEPREFIX=&quot;/home/dfaure/.wine&quot; wine start /ProgIDOpen giffile %f

Isn&apos;t this a solution to this problem? I.e. change step 1 to prepend &quot;env&quot; before the env var?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2118051</commentid>
    <comment_count>7</comment_count>
    <who name="Ahmad Samir">a.samirh78</who>
    <bug_when>2022-04-18 22:35:44 +0000</bug_when>
    <thetext>FTR, the commit was reverted.

The solution David posted works?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2138357</commentid>
    <comment_count>8</comment_count>
    <who name="Ahmad Samir">a.samirh78</who>
    <bug_when>2022-07-11 20:21:38 +0000</bug_when>
    <thetext>Ping.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2140328</commentid>
    <comment_count>9</comment_count>
    <who name="Nicolas Fella">nicolas.fella</who>
    <bug_when>2022-07-20 09:37:01 +0000</bug_when>
    <thetext>yes, env FOO=bar works</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2143351</commentid>
    <comment_count>10</comment_count>
    <who name="Bug Janitor Service">bug-janitor</who>
    <bug_when>2022-08-04 04:35:27 +0000</bug_when>
    <thetext>Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED &gt; WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2146725</commentid>
    <comment_count>11</comment_count>
    <who name="Bug Janitor Service">bug-janitor</who>
    <bug_when>2022-08-19 04:35:36 +0000</bug_when>
    <thetext>This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED &gt; WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>