Remove an unnecessary check that may give spurious failures on modified server 
where 999 is a valid ID.

-- 
Simo Sorce * Red Hat, Inc. * New York
From efbe4a5d21b8567f146c9170becd54e3dd671498 Mon Sep 17 00:00:00 2001
From: Simo Sorce <sso...@redhat.com>
Date: Thu, 26 Jul 2012 14:30:39 -0400
Subject: [PATCH] Do not check for DNA magic values

The DNA magic value can be arbitrarily changed by admins so we cannot use a
const value to check. And we relly do not need to check at all. If the DNA
plugin is broken and leaves magic values to reach the post-op stage we have
bigger problems. So just simply get rid of this check.
---
 daemons/ipa-slapi-plugins/ipa-sidgen/ipa_sidgen.h        |    2 --
 daemons/ipa-slapi-plugins/ipa-sidgen/ipa_sidgen_common.c |    6 ------
 2 files changed, 8 deletions(-)

diff --git a/daemons/ipa-slapi-plugins/ipa-sidgen/ipa_sidgen.h b/daemons/ipa-slapi-plugins/ipa-sidgen/ipa_sidgen.h
index cfb624bde5750d406d631cb1c250c08d1a4366a2..dec2a652464ec451ca7d32b9a82dd958202298e5 100644
--- a/daemons/ipa-slapi-plugins/ipa-sidgen/ipa_sidgen.h
+++ b/daemons/ipa-slapi-plugins/ipa-sidgen/ipa_sidgen.h
@@ -54,8 +54,6 @@
 #define IPANT_USER_ATTRS "ipantuserattrs"
 #define IPANT_GROUP_ATTRS "ipantgroupattrs"
 
-#define IPA_DNA_MAGIC 999
-
 #define IPA_PLUGIN_NAME "ipa-sidgen-postop"
 #define IPA_SIDGEN_FEATURE_DESC "IPA SIDGEN postop plugin"
 #define IPA_SIDGEN_PLUGIN_DESC "Add a SID to newly added or modified " \
diff --git a/daemons/ipa-slapi-plugins/ipa-sidgen/ipa_sidgen_common.c b/daemons/ipa-slapi-plugins/ipa-sidgen/ipa_sidgen_common.c
index cbbb2ef183f2d94826a9ead20ca1fc39daa09599..d7e6ac39a57ce26cf6ac7196a1797c44e5a65f77 100644
--- a/daemons/ipa-slapi-plugins/ipa-sidgen/ipa_sidgen_common.c
+++ b/daemons/ipa-slapi-plugins/ipa-sidgen/ipa_sidgen_common.c
@@ -479,12 +479,6 @@ int find_sid_for_ldap_entry(struct slapi_entry *entry,
         goto done;
     }
 
-    if (uid_number == IPA_DNA_MAGIC || gid_number == IPA_DNA_MAGIC) {
-        LOG_FATAL("Looks that DNA plugin was not run before.\n");
-        ret = LDAP_OPERATIONS_ERROR;
-        goto done;
-    }
-
     if (uid_number >= UINT32_MAX || gid_number >= UINT32_MAX) {
         LOG_FATAL("ID value too large.\n");
         ret = LDAP_CONSTRAINT_VIOLATION;
-- 
1.7.10.4

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to