Blame SOURCES/BZ-1113395-verify-permissions-mask.patch

65829f
commit bb6908d630966d9e385659516c2759c47c0e2ee7
65829f
Author: Valentina Mukhamedzhanova <vmukhame@redhat.com>
65829f
Date:   Fri Mar 28 10:41:39 2014 +0100
65829f
65829f
    Mask st_mode to fix verifying permissions for ghost files. BZ 1045415
65829f
65829f
diff --git a/yum/packages.py b/yum/packages.py
65829f
index 69c612f..9522235 100644
65829f
--- a/yum/packages.py
65829f
+++ b/yum/packages.py
65829f
@@ -2033,11 +2033,14 @@ class YumInstalledPackage(YumHeaderPackage):
65829f
                     problems.append(prob)
65829f
 
65829f
                 my_mode = my_st.st_mode
65829f
+                pf_mode = pf.mode
65829f
+                perm_mask = 0777
65829f
                 if 'ghost' in ftypes: #  This is what rpm does, although it
65829f
-                    my_mode &= 0777   # doesn't usually get here.
65829f
-                if check_perms and pf.verify_mode and my_mode != pf.mode:
65829f
+                    my_mode &= perm_mask   # doesn't usually get here.
65829f
+                    pf_mode &= perm_mask
65829f
+                if check_perms and pf.verify_mode and my_mode != pf_mode:
65829f
                     prob = _PkgVerifyProb('mode', 'mode does not match', ftypes)
65829f
-                    prob.database_value = pf.mode
65829f
+                    prob.database_value = pf_mode
65829f
                     prob.disk_value     = my_st.st_mode
65829f
                     problems.append(prob)
65829f