From 3b98ed15bcbcd5c458b98c251277dfa5b24ffa11 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Tue, 11 Mar 2014 22:50:05 -0400 Subject: [PATCH] now stat skips md5 if file isn't readable --- files/stat | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/files/stat b/files/stat index 2839ca8e06f..8c717a395c4 100644 --- a/files/stat +++ b/files/stat @@ -132,8 +132,9 @@ def main(): if S_ISLNK(mode): d['lnk_source'] = os.path.realpath(path) - if S_ISREG(mode) and get_md5: - d['md5'] = module.md5(path) + if S_ISREG(mode) and get_md5 and os.access(path,os.R_OK): + d['md5'] = module.md5(path) + try: pw = pwd.getpwuid(st.st_uid)