From af67fa5d9578ead495de93da70d28bfcb002a438 Mon Sep 17 00:00:00 2001 From: Nicolas Iooss Date: Sun, 1 Sep 2019 20:06:34 +0200 Subject: [PATCH] python/chcat: remove unnecessary assignment chcat_add() defines variable cmd twice before calling subprocess.check_call(cmd, ...). Remove the first definition. This bug was found using lgtm.com analyzer: https://lgtm.com/projects/g/SELinuxProject/selinux/snapshot/eac5e661ca7300800000496fe13985286af70c6d/files/python/chcat/chcat?sort=name&dir=ASC&mode=heatmap#L118 Signed-off-by: Nicolas Iooss --- python/chcat/chcat | 1 - 1 file changed, 1 deletion(-) diff --git a/python/chcat/chcat b/python/chcat/chcat index ba398684..fdd2e46e 100755 --- a/python/chcat/chcat +++ b/python/chcat/chcat @@ -115,7 +115,6 @@ def chcat_add(orig, newcat, objects, login_ind): errors = 0 sensitivity = newcat[0] cat = newcat[1] - cmd = 'chcon -l %s' % sensitivity for f in objects: (rc, c) = selinux.getfilecon(f) con = c.split(":")[3:]