From 463a1c21ea8e011142513034df9b7a1340c5eb6f 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 --- library/files/stat | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/library/files/stat b/library/files/stat index 2839ca8e06f..8c717a395c4 100644 --- a/library/files/stat +++ b/library/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)