From 6c89af04fbd13d0bf9707bdc0704d1a117f3d05c Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 22 Nov 2014 13:57:27 +0100 Subject: fix race condition + forgot to update dist MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/plugins/users.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/plugins') diff --git a/src/plugins/users.py b/src/plugins/users.py index e5124f0..10e59e5 100644 --- a/src/plugins/users.py +++ b/src/plugins/users.py @@ -93,7 +93,10 @@ class Users: users, rc = {}, [] for tty in ttys: - attr = os.stat('/dev/' + tty) + try: + attr = os.stat('/dev/' + tty) + except: + continue if ('/' not in tty) and (attr.st_uid == 0): if not (try_to_find_root and (attr.st_mode == 0o20600)): continue -- cgit v1.2.3-70-g09d2