--- a/utils/aa-notify +++ b/utils/aa-notify @@ -13,17 +13,6 @@ # # ---------------------------------------------------------------------- # -# /etc/apparmor/notify.conf: -# # set to 'yes' to enable AppArmor DENIED notifications -# show_notifications="yes" -# -# # only people in use_group can run this script -# use_group="admin" -# -# $HOME/.apparmor/notify.conf can have: -# # set to 'yes' to enable AppArmor DENIED notifications -# show_notifications="yes" -# # In a typical desktop environment one would run as a service the # command: # /usr/bin/aa-notify -p -w 10 @@ -35,7 +24,6 @@ import re import sys import time import struct -import notify2 import psutil import pwd import grp @@ -60,56 +48,9 @@ def get_user_login(): username = os.getlogin() return username - -def get_last_login_timestamp(username): - '''Directly read wtmp and get last login for user as epoch timestamp''' - timestamp = 0 - filename = '/var/log/wtmp' - last_login = 0 - - debug_logger.debug('Username: {}'.format(username)) - - with open(filename, "rb") as wtmp_file: - offset = 0 - wtmp_filesize = os.path.getsize(filename) - debug_logger.debug('WTMP filesize: {}'.format(wtmp_filesize)) - while offset < wtmp_filesize: - wtmp_file.seek(offset) - offset += 384 # Increment for next entry - - type = struct.unpack("