From 06cb50b1e38263c365ed7abbccb22a04fb250c44 Mon Sep 17 00:00:00 2001 From: 0xphk Date: Sun, 5 Jun 2022 22:58:31 +0200 Subject: [PATCH] #1308: Add updatedb (mlocate) pattern to sudo rule * added updatedb(mlocate) to sudo rules * Add test Co-authored-by: phk Co-authored-by: Pablo Santiago Blum de Aguiar --- tests/rules/test_sudo.py | 1 + thefuck/rules/sudo.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/rules/test_sudo.py b/tests/rules/test_sudo.py index 195bee4f..4a4931c6 100644 --- a/tests/rules/test_sudo.py +++ b/tests/rules/test_sudo.py @@ -12,6 +12,7 @@ from thefuck.types import Command 'need root', 'shutdown: NOT super-user', 'Error: This command has to be run with superuser privileges (under the root user on most systems).', + 'updatedb: can not open a temporary file for `/var/lib/mlocate/mlocate.db', 'must be root', 'You don\'t have access to the history DB.', "error: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/ipaddr.py'"]) diff --git a/thefuck/rules/sudo.py b/thefuck/rules/sudo.py index 97aab31f..0c83ba7b 100644 --- a/thefuck/rules/sudo.py +++ b/thefuck/rules/sudo.py @@ -24,7 +24,8 @@ patterns = ['permission denied', 'you don\'t have write permissions', 'use `sudo`', 'sudorequirederror', - 'error: insufficient privileges'] + 'error: insufficient privileges', + 'updatedb: can not open a temporary file'] def match(command):