aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenneth D'souza <kennethdsouza94@gmail.com>2019-09-20 10:13:17 +0530
committerBryn M. Reeves <bmr@redhat.com>2019-10-08 15:18:48 +0100
commitd7ebe2b3eb66ca7df5f1d3a7161c98b0591528c4 (patch)
treef5279de775e4b48eed2e7a2e9e4ba761d1cc8b8b
parent5c0b2d56313b6fa58b46802317c98b89e5a68508 (diff)
downloadsos-d7ebe2b3eb66ca7df5f1d3a7161c98b0591528c4.tar.gz
[filesys] fix postprocessing for /etc/fstab passwords.
The current regex will replace the entire string after password= with * including the mount options. This patch fixes this issue by stopping the replacement when "," (mount option separator)is detected. Before patch: //cifs-server/share /mnt cifs username=user1,password=******** After patch: //cifs-sever/share /mnt cifs username=user1,password=********,nounix,vers=1.0 0 0 Resolves: #1789 Signed-off-by: Kenneth D'souza <kennethdsouza94@gmail.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r--sos/plugins/filesys.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/sos/plugins/filesys.py b/sos/plugins/filesys.py
index 61b3d8d2..cb70277e 100644
--- a/sos/plugins/filesys.py
+++ b/sos/plugins/filesys.py
@@ -58,7 +58,7 @@ class Filesys(Plugin, DebianPlugin, UbuntuPlugin):
def postproc(self):
self.do_file_sub(
"/etc/fstab",
- r"(password=)[^\s]*",
+ r"(password=)[^,\s]*",
r"\1********"
)