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

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