Skip to content
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

Shield Steam from timezone mess #214

Closed
nanonyme opened this issue Sep 8, 2018 · 8 comments
Closed

Shield Steam from timezone mess #214

nanonyme opened this issue Sep 8, 2018 · 8 comments

Comments

@nanonyme
Copy link
Collaborator

nanonyme commented Sep 8, 2018

TLDR: Steam timezone handling relies on assumptions about zoneinfo files instead of just UTC deltas being used.

Copy from @tomgar

The workaround would be better if it interprets a TZ env which references a file. In my case I have set >TZ as :/etc/localtime for good reasons:
https://blog.packagecloud.io/eng/2017/02/21/set-environment-variable-save-thousands-of-system-calls/
, being this way of setting up the TZ env part of the spec:
https://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html (search for third format)

In your steam-wrapper, you are almost there... you need to check if the TZ env starts with a colon and >then check if it's a symbolic link and follow it. Either after that or if it's not a symbolic link, just extract >the filename as you are already doing in that for loop.

Steam doesn't work with this kind of TZ representation so that's why I'm commenting here:
ValveSoftware/steam-for-linux#5609

Hopefully Steam will fix this issue in their side some day...

See #120
Essentially we should in all cases normalize input into something that Steam likes whether or not TZ is given in environment.

@nanonyme
Copy link
Collaborator Author

nanonyme commented Sep 8, 2018

So there's a couple cases for TZ

  1. Difference from UTC. By far easiest for us to use, I think /etc/localtime has all the relevant information for this
  2. Format with daylight saving time. Seems really complex, I would really hope this isn't needed
  3. :characters name of the file that contains zoneinfo. This is a bit iffy. That file might not exist in the sandbox; should also be tested if this in fact has the same bug as 4
  4. :characters that does not begin with slash and refers to zoneinfo file; also a bit iffy. Should be just fallback to /etc/localtime?

Seems glibc violates its own documentation though and fourth case is allowed to be present without leading ":". This might well be a bug from early ages of glibc that is now an undocumented feature.

nanonyme added a commit that referenced this issue Sep 8, 2018
See #214, supporting TZ fully might be reasonably complex given the semantics of it so for now just don't let the host TZ leak into application context without an explicit override. This should make the TZ workaround be used for everyone unless there's an override.
@nanonyme nanonyme mentioned this issue Sep 8, 2018
@nanonyme
Copy link
Collaborator Author

nanonyme commented Sep 8, 2018

So currently it works so that your host TZ is simply ignored. If you really know what you're doing

flatpak --user override --env=TZ=zoneinfo com.valvesoftware.Steam

works to set different zoneinfo than what the algorithm gives

@nanonyme
Copy link
Collaborator Author

nanonyme commented Sep 8, 2018

@tomgar do you think that's sufficient or do we need real TZ handling?

@tomgar
Copy link

tomgar commented Sep 8, 2018

Sorry, I didn't see the "override" in your command.

I think it's ok... Maybe you should output a message if you had to forcely mask the TZ env. Linux users are used to see the command line output first before going to look for answers in case there are consequences of such masking.

@tomgar
Copy link

tomgar commented Sep 8, 2018

By the way, I appreciate the efforts you're taking with this.

@nanonyme
Copy link
Collaborator Author

nanonyme commented Sep 9, 2018

I guess the console output could also have a link to https://github.com/flathub/com.valvesoftware.Steam/wiki/Frequently-asked-questions

I've been trying to document reasons for that kind of hammer solutions there

@nanonyme
Copy link
Collaborator Author

nanonyme commented Sep 9, 2018

Note current behaviour has the downside that timezone handling isn't dynamic like it's normally supposed to be. You need to restart Steam to change timezone

@nanonyme
Copy link
Collaborator Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants