aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Desrochers <eric.desrochers@canonical.com>2019-08-30 13:26:41 -0400
committerBryn M. Reeves <bmr@redhat.com>2019-10-01 15:08:59 +0100
commita08196b8c02924a47271d6d31660b1ad528f09dd (patch)
treeba1e1e8834ae13862485e5c34857907a119a7b64
parent7d56ce2fbc140024001013bbc2309295cab3331d (diff)
downloadsos-a08196b8c02924a47271d6d31660b1ad528f09dd.tar.gz
[last] split lastlog per UID ranges
lastlog by default reports all users regardless of their UID and doesn't give any hints about UID. In some context, such as users obfuscation inside SOSCleaner, it is useful to know which users are part of which UID range so that we can then decide if this need to be obfuscated or not. Splitting the file by UID range will highly benefit SOSCleaner but I'm sure it could benefit other purposes as well. Reserves for dynamically allocated system users and groups. "lastlog -u 0-999" Min/max values for automatic uid selection in useradd. "lastlog -u 1000-60000", Centrally and statically allocates users and groups. "lastlog -u 60001-65536" Further reservations. "lastlog -u 65537-4294967295" https://en.wikipedia.org/wiki/User_identifier "The majority of modern Unix-like systems (e.g., Solaris-2.0 in 1990, Linux 2.4 in 2001) have switched to 32-bit UIDs, allowing 4,294,967,296 (232) unique IDs." Closes: #1743 Resolves: #1770 Signed-off-by: Eric Desrochers <eric.desrochers@canonical.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r--sos/plugins/last.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/sos/plugins/last.py b/sos/plugins/last.py
index 4da3f5cf..57462b93 100644
--- a/sos/plugins/last.py
+++ b/sos/plugins/last.py
@@ -21,7 +21,11 @@ class Last(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
self.add_cmd_output([
"last reboot",
"last shutdown",
- "lastlog"
+ "lastlog",
+ "lastlog -u 0-999",
+ "lastlog -u 1000-60000",
+ "lastlog -u 60001-65536",
+ "lastlog -u 65537-4294967295"
])
# vim: et ts=4 sw=4