From 5f586b9b0b89d38d5bb03ce9da2c6dd066460f69 Mon Sep 17 00:00:00 2001
From: Jan Zeleny <jzeleny@redhat.com>
Date: Mon, 16 Jan 2012 06:57:20 -0500
Subject: [PATCH 05/10] Renamed some sysdb constants for their wider usage

---
 src/db/sysdb.h                    |    8 +++-----
 src/providers/ipa/ipa_common.c    |    4 ++--
 src/providers/ipa/ipa_netgroups.c |    8 ++++----
 3 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/src/db/sysdb.h b/src/db/sysdb.h
index 31b988eb14741b3de625c51d85cb7059fbd7c36d..573dc652577234a0eb57794238d989f19743026a 100644
--- a/src/db/sysdb.h
+++ b/src/db/sysdb.h
@@ -86,14 +86,9 @@
 
 #define SYSDB_NETGROUP_TRIPLE "netgroupTriple"
 #define SYSDB_ORIG_NETGROUP_MEMBER "originalMemberNisNetgroup"
-#define SYSDB_ORIG_NETGROUP_MEMBER_USER "originalMemberUser"
-#define SYSDB_ORIG_NETGROUP_MEMBER_HOST "originalMemberHost"
 #define SYSDB_ORIG_NETGROUP_EXTERNAL_HOST "originalExternalHost"
 #define SYSDB_NETGROUP_DOMAIN "nisDomain"
 #define SYSDB_NETGROUP_MEMBER "memberNisNetgroup"
-#define SYSDB_NETGROUP_MEMBER_USER "memberUser"
-#define SYSDB_NETGROUP_MEMBER_HOST "memberHost"
-#define SYSDB_NETGROUP_MEMBER_EXTERNAL_HOST "memberExternalHost"
 #define SYSDB_DESCRIPTION   "description"
 
 #define SYSDB_CACHEDPWD "cachedPassword"
@@ -106,6 +101,9 @@
 #define SYSDB_ORIG_MODSTAMP "originalModifyTimestamp"
 #define SYSDB_ORIG_MEMBEROF "originalMemberOf"
 
+#define SYSDB_ORIG_MEMBER_USER "originalMemberUser"
+#define SYSDB_ORIG_MEMBER_HOST "originalMemberHost"
+
 #define SYSDB_USN "entryUSN"
 #define SYSDB_HIGH_USN "highestUSN"
 
diff --git a/src/providers/ipa/ipa_common.c b/src/providers/ipa/ipa_common.c
index 3116b79155019a4c1bf44f8e5a5ace0153029da1..562e24078a55ae23524abef1ae15126dbc9e6a0a 100644
--- a/src/providers/ipa/ipa_common.c
+++ b/src/providers/ipa/ipa_common.c
@@ -168,8 +168,8 @@ struct sdap_attr_map ipa_netgroup_map[] = {
     { "ipa_netgroup_name", "cn", SYSDB_NAME, NULL },
     { "ipa_netgroup_member", "member", SYSDB_ORIG_NETGROUP_MEMBER, NULL },
     { "ipa_netgroup_member_of", "memberOf", SYSDB_MEMBEROF, NULL },
-    { "ipa_netgroup_member_user", "memberUser", SYSDB_ORIG_NETGROUP_MEMBER_USER, NULL },
-    { "ipa_netgroup_member_host", "memberHost", SYSDB_ORIG_NETGROUP_MEMBER_HOST, NULL },
+    { "ipa_netgroup_member_user", "memberUser", SYSDB_ORIG_MEMBER_USER, NULL },
+    { "ipa_netgroup_member_host", "memberHost", SYSDB_ORIG_MEMBER_HOST, NULL },
     { "ipa_netgroup_member_ext_host", "externalHost", SYSDB_ORIG_NETGROUP_EXTERNAL_HOST, NULL },
     { "ipa_netgroup_domain", "nisDomainName", SYSDB_NETGROUP_DOMAIN, NULL },
     { "ipa_netgroup_uuid", "ipaUniqueID", SYSDB_UUID, NULL },
diff --git a/src/providers/ipa/ipa_netgroups.c b/src/providers/ipa/ipa_netgroups.c
index d61728f57d31fb7231536dbcbc922d75ff17fbf2..47fcffac2b62ab6a9e1f947db4309a67f55bb0ce 100644
--- a/src/providers/ipa/ipa_netgroups.c
+++ b/src/providers/ipa/ipa_netgroups.c
@@ -330,11 +330,11 @@ static void ipa_get_netgroups_process(struct tevent_req *subreq)
                                  &ng_found);
         if (ret != EOK) goto done;
 
-        ret = sysdb_attrs_get_el(netgroups[i], SYSDB_ORIG_NETGROUP_MEMBER_USER,
+        ret = sysdb_attrs_get_el(netgroups[i], SYSDB_ORIG_MEMBER_USER,
                                  &user_found);
         if (ret != EOK) goto done;
 
-        ret = sysdb_attrs_get_el(netgroups[i], SYSDB_ORIG_NETGROUP_MEMBER_HOST,
+        ret = sysdb_attrs_get_el(netgroups[i], SYSDB_ORIG_MEMBER_HOST,
                                  &host_found);
         if (ret != EOK) goto done;
 
@@ -893,7 +893,7 @@ static int ipa_netgr_process_all(struct ipa_get_netgroups_state *state)
         /* Load all UIDs */
         DEBUG(SSSDBG_TRACE_ALL, ("Extracting user members of netgroup %d\n", i));
         ret = extract_members(state, state->netgroups[i],
-                              SYSDB_ORIG_NETGROUP_MEMBER_USER,
+                              SYSDB_ORIG_MEMBER_USER,
                               state->new_users,
                               &uids, &uids_count);
         if (ret != EOK) {
@@ -903,7 +903,7 @@ static int ipa_netgr_process_all(struct ipa_get_netgroups_state *state)
 
         DEBUG(SSSDBG_TRACE_ALL, ("Extracting host members of netgroup %d\n", i));
         ret = extract_members(state, state->netgroups[i],
-                              SYSDB_ORIG_NETGROUP_MEMBER_HOST,
+                              SYSDB_ORIG_MEMBER_HOST,
                               state->new_hosts,
                               &hosts, &hosts_count);
         if (ret != EOK) {
-- 
1.7.6.4

