From: David Mulder Date: Wed, 7 Dec 2022 16:51:12 +0000 (-0700) Subject: gp: Re-create files if manually removed X-Git-Tag: talloc-2.4.0~179 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e6156b135021db5a6335bb8779acefff2f6a0bd3;p=thirdparty%2Fsamba.git gp: Re-create files if manually removed Signed-off-by: David Mulder Reviewed-by: Jeremy Allison --- diff --git a/python/samba/gp/gpclass.py b/python/samba/gp/gpclass.py index 42ce3dc63fb..d6ada1dbaad 100644 --- a/python/samba/gp/gpclass.py +++ b/python/samba/gp/gpclass.py @@ -544,7 +544,8 @@ class gp_file_applier(gp_applier): # Ignore removal if this policy is applied and hasn't changed old_val_hash, old_val_files = self.__parse_value(old_val, sep) if (old_val_hash != value_hash or \ - self.cache_get_apply_state() == GPOSTATE.ENFORCE): + self.cache_get_apply_state() == GPOSTATE.ENFORCE) or \ + not all([os.path.exists(f) for f in old_val_files]): self.unapply(guid, attribute, old_val_files) else: # If policy is already applied, skip application diff --git a/selftest/knownfail.d/gpo b/selftest/knownfail.d/gpo deleted file mode 100644 index 7ea9bca77f8..00000000000 --- a/selftest/knownfail.d/gpo +++ /dev/null @@ -1 +0,0 @@ -samba.tests.gpo.GPOTests.test_gp_centrify_sudoers_ext*