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

Store .lock/.socket files in XDG_RUNTIME_DIR #10842

Open
jamessan opened this issue Jun 1, 2024 · 6 comments
Open

Store .lock/.socket files in XDG_RUNTIME_DIR #10842

jamessan opened this issue Jun 1, 2024 · 6 comments
Assignees
Milestone

Comments

@jamessan
Copy link

jamessan commented Jun 1, 2024

// According to documentation we should use RuntimeLocation on *nixes, but even Qt doesn't respect
// this and creates sockets in TempLocation, so let's be consistent.
m_lockFile = new QLockFile(QStandardPaths::writableLocation(QStandardPaths::TempLocation) + "/" + lockName);

Given that /tmp may be periodically cleaned during the uptime of a system, it seems like these should live under $XDG_RUNTIME_DIR.

@droidmonkey
Copy link
Member

we'll consider that when we move to Qt6

@droidmonkey droidmonkey self-assigned this Jun 1, 2024
@droidmonkey droidmonkey added this to the v2.8.0 milestone Jun 1, 2024
@HanabishiRecca
Copy link

HanabishiRecca commented Jun 9, 2024

A more pronounced issue here that there could be more than 1 user in the system. If they open the app simultaneously... well, it will be a mess.

Also, /tmp is world-readable, which is not really good for security.

@droidmonkey
Copy link
Member

Yes good points, although there is nothing sensitive in this lock file except for its mere presence.

@jamessan
Copy link
Author

jamessan commented Jun 9, 2024

A more pronounced issue here that there could be more than 1 user in the system. If they open the app simultaneously... well, it will be a mess.

Not really, since the username is part of the filename --

QString userName = qgetenv("USER");
if (userName.isEmpty()) {
userName = qgetenv("USERNAME");
}

@droidmonkey
Copy link
Member

Yes that is also true

@HanabishiRecca
Copy link

HanabishiRecca commented Jun 9, 2024

Yeah, I didn't notice that. Sorry, disregard my gripes then.

Although, it'd better be a user id instead. But using XDG_RUNTIME_DIR is the best solution anyway.

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

3 participants