Skip to content

Commit 832f598

Browse files
committed
fix check group right on homefolder security check #243
1 parent b63eba0 commit 832f598

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

additional/python/check_home_folder_rights.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22

33
def check_home_folder_rights(home_folder):
44
lines = jessentials.run_command(f"ls -al {home_folder}", False, True)
5-
if lines[1][7] != "-" or lines[1][8] != "-" or lines[1][9] != "-":
5+
# Check if the home folder has the right permissions for others (no permissions at all) and the right group permissions (no write permissions)
6+
if lines[1][7] != "-" or lines[1][8] != "-" or lines[1][9] != "-" or lines[1][5] != "-":
67
print(f"homefoldernotsecure: {lines[1]}")

lib/services/linux.dart

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2167,7 +2167,13 @@ class Linux {
21672167
/// removes all rights for others at the home folder
21682168
static Future<void> fixHomeFolderPermissions() async {
21692169
runCommandWithCustomArguments(
2170-
"/usr/bin/chmod", ["o-rwx", Linux.getHomeDirectory()]);
2170+
"/usr/bin/chmod",
2171+
["o-rwx", Linux.getHomeDirectory()],
2172+
);
2173+
runCommandWithCustomArguments(
2174+
"/usr/bin/chmod",
2175+
["g-w", Linux.getHomeDirectory()],
2176+
);
21712177
}
21722178

21732179
static Future<void> openAdditionalSoftwareSourcesSettings() async {

0 commit comments

Comments
 (0)