Skip to content

Commit

Permalink
[setlocale] Check that user belongs to users.
Browse files Browse the repository at this point in the history
A little bit of fortifying this while at it.

Signed-off-by: Tomi Leppänen <tomi.leppanen@jolla.com>
  • Loading branch information
Tomin1 committed Feb 26, 2020
1 parent 29cd80d commit 660dd17
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions setlocale/main.cpp
Expand Up @@ -110,6 +110,11 @@ int main(int argc, char *argv[])
return EXIT_FAILURE;
}

if (!sailfish_access_control_hasgroup(getuid(), "users")) {
qWarning() << "User with id" << getuid() << "is not member of users group";
return EXIT_FAILURE;
}

QString configPath = localeConfigPath();

if (configPath.isEmpty()) {
Expand Down

0 comments on commit 660dd17

Please sign in to comment.