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

Adhere to XDG spec #18

Closed
ghost opened this issue Jun 12, 2017 · 2 comments
Closed

Adhere to XDG spec #18

ghost opened this issue Jun 12, 2017 · 2 comments

Comments

@ghost
Copy link

ghost commented Jun 12, 2017

Would be better to follow https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html for salt (and all other) files:
Use $XDG_CONFIG_HOME/ext4_encryption_salt instead of $HOME/.ext4_encryption_salt

@neithernut
Copy link
Owner

neithernut commented Jun 12, 2017

Yeah, I regularly forget about xdg.
Well, we should still have $HOME as a fallback. XDG_CONFIG_HOME is not set on all systems. But that's what the spec says anyway.

@neithernut
Copy link
Owner

Turns out it isn't that simple. we (usually) are part of the process setting up the session. At the point the module is invoked, the user environment may not be setup. That's one the reasons why we don't query the HOME variable but look up the home directory through libpam, by the way.

In my use case, for example, the module is invoked very early in the login process. Sourcing the bash profile and setting environment variables like XDG_CONFIG_HOME, on the other hand, is pretty much the last thing in that process.

The even bigger issue is that the salts are loaded during authentication and not during session-setup. We do this because the password entered by the user is not available during session setup by default. (I decided to rather have the encryption keys shipped from one phase to the other than a user password in clear text.)

So while you brought up a very good point, this is pretty much a "won't fix". Sorry for that.

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

No branches or pull requests

1 participant