New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Quoting "$vars" in xsession #25199
Quoting "$vars" in xsession #25199
Conversation
@@ -33,7 +33,7 @@ let | |||
#! ${pkgs.bash}/bin/bash | |||
|
|||
# Handle being called by SDDM. | |||
if test "''${1:0:1}" = / ; then eval exec $1 $2 ; fi | |||
if test "''${1:0:1}" = / ; then eval exec "$1" "$2" ; fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one also handles multiple arguments (more then three) correctly:
if test "''${1:0:1}" = / ; then
shift;
eval exec "$@";
fi
it did not work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without being able to reasonably test the change, I was trying to limit it to things I was 100% sure would work.
LGTM
the gdm test loops over:
forever. Also does this on master, and appears to do the same on 17.03 |
Can you provide a configuration which reproduces the problem? I'm not sure how to test in your use case. |
Something like:
should be sufficient. Selecting from the session options on login doesn't work - IIRC you get i3 + xterm every time. (Or else xsession crashes entirely...) I'm not sure how to test it automatically. |
A friend is also experiencing the very same problem with i3 and slim. Does anybody know which commit introduced this regression? |
@fpletz I don't - since I switched to NixOS on my desktop, this has been an issue for me. It seems to be a problem with the way that SDDM calls xsession |
Okay, let's merge this. Quoting shell variables, especially in this case, is good practice anyways. ;) Thanks a lot! |
I'm just worried we depended upon the bad behavior somehow. Should we backport? |
On the one hand, I can't see how Nix would depend on erroneous shell splitting; worse: I have no idea to determine that. What I was thinking though: I would have preferred to start this process by overriding my local definition of xession, but the file is defined in the module. Would it make sense to extract it out to a package that could be overridden more easily, especially since its one of those places that a lot of system configuration happens? Alternatively, if there's a way to override (or overlay?) modules, that would be great, and I'd've done that in a heartbeat if I understood how. |
@grahamc If the "backport" question relates to 17.03, I'd be pro that. |
Together with #25138 this should fix all problems with all display/login managers. I would wait ~1 week (to see if this will cause any unexpected problems on |
(cherry picked from commit 0d72629)
Motivation for this change
The clause that fixes the call when SDDM execs xsession was broken (not just for me?) because the argument variables weren't quoted, so session names like
'xmonad + xterm'
were split by bash, and the single quotes were treated as syntax errors.I think this will correct the issue, but I'm unclear how to test the change locally to be sure, since it's a module change, and the actual script is produced by a function call.
Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)