Skip to content

Commit

Permalink
cinnamon-settings-users: Don't use w -hs
Browse files Browse the repository at this point in the history
It segfaults in Ubuntu 24.04 for some reason.
We only need to count lines without headers anyway, so -h is good
enough.

Fixes linuxmint/mint22-beta#200
  • Loading branch information
clefebvre committed Jul 19, 2024
1 parent 5061b9c commit 0ad4d3f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,7 @@ def on_user_selection(self, selection):
self.builder.get_object("box_users").show()

# Count the number of connections for the currently logged-in user
connections = int(subprocess.check_output(["w", "-hs", user.get_user_name()]).decode("utf-8").count("\n"))
connections = int(subprocess.check_output(["w", "-h", user.get_user_name()]).decode("utf-8").count("\n"))
if connections > 0:
self.builder.get_object("button_delete_user").set_sensitive(False)
self.builder.get_object("button_delete_user").set_tooltip_text(_("This user is currently logged in"))
Expand Down

0 comments on commit 0ad4d3f

Please sign in to comment.