From d48b5f0f50e85855338e89053f1c0046cf6a7f55 Mon Sep 17 00:00:00 2001
From: Stephen Gallagher <sgallagh@redhat.com>
Date: Wed, 14 Dec 2011 14:32:05 -0500
Subject: [PATCH 2/3] Move child_common routines to util

---
 Makefile.am                             |   14 +++++++-------
 src/providers/data_provider_be.c        |    2 +-
 src/providers/dp_backend.h              |    2 +-
 src/providers/ipa/ipa_dyndns.c          |    2 +-
 src/providers/ipa/ipa_init.c            |    2 +-
 src/providers/krb5/krb5_auth.c          |    2 +-
 src/providers/krb5/krb5_auth.h          |    2 +-
 src/providers/krb5/krb5_child.c         |    2 +-
 src/providers/krb5/krb5_child_handler.c |    2 +-
 src/providers/krb5/krb5_init.c          |    2 +-
 src/providers/ldap/ldap_child.c         |    2 +-
 src/providers/ldap/ldap_init.c          |    2 +-
 src/providers/ldap/sdap_child_helpers.c |    2 +-
 src/{providers => util}/child_common.c  |    2 +-
 src/{providers => util}/child_common.h  |    0
 15 files changed, 20 insertions(+), 20 deletions(-)
 rename src/{providers => util}/child_common.c (99%)
 rename src/{providers => util}/child_common.h (100%)

diff --git a/Makefile.am b/Makefile.am
index fe62a3eba6caff340e92b521a930406e603b593a..6a63a5320d0ecea8c47d07f7f1cd7788f9e0d10d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -321,7 +321,7 @@ dist_noinst_HEADERS = \
     src/providers/dp_backend.h \
     src/providers/fail_over.h \
     src/providers/providers.h \
-    src/providers/child_common.h \
+    src/util/child_common.h \
     src/providers/simple/simple_access.h \
     src/providers/krb5/krb5_auth.h \
     src/providers/krb5/krb5_common.h \
@@ -358,6 +358,9 @@ libsss_debug_la_SOURCES = \
     src/util/debug.c \
     src/util/sss_log.c
 
+noinst_LTLIBRARIES += libsss_child.la
+libsss_child_la_SOURCES = src/util/child_common.c
+
 noinst_LTLIBRARIES += libsss_util.la
 libsss_util_la_SOURCES = \
     src/confdb/confdb.c \
@@ -386,6 +389,7 @@ libsss_util_la_SOURCES = \
 libsss_util_la_LIBADD = \
     $(SSSD_LIBS) \
     $(UNICODE_LIBS) \
+    libsss_child.la \
     libsss_crypt.la \
     libsss_debug.la
 
@@ -436,7 +440,6 @@ sssd_pam_LDADD = \
     libsss_util.la
 
 sssd_be_SOURCES = \
-    src/providers/child_common.c \
     src/providers/data_provider_be.c \
     src/providers/data_provider_fo.c \
     src/providers/data_provider_opts.c \
@@ -830,7 +833,6 @@ dist_noinst_DATA += \
 ####################
 libsss_ldap_la_SOURCES = \
     src/util/find_uid.c \
-    src/providers/child_common.c \
     src/providers/ldap/ldap_id.c \
     src/providers/ldap/ldap_id_enum.c \
     src/providers/ldap/ldap_id_cleanup.c \
@@ -894,7 +896,6 @@ libsss_simple_la_LDFLAGS = \
 
 libsss_krb5_la_SOURCES = \
     src/util/find_uid.c \
-    src/providers/child_common.c \
     src/providers/krb5/krb5_utils.c \
     src/providers/krb5/krb5_become_user.c \
     src/providers/krb5/krb5_delayed_online_authentication.c \
@@ -919,7 +920,6 @@ libsss_krb5_la_LDFLAGS = \
     -module
 
 libsss_ipa_la_SOURCES = \
-    src/providers/child_common.c \
     src/providers/ipa/ipa_init.c \
     src/providers/ipa/ipa_common.c \
     src/providers/ipa/ipa_utils.c \
@@ -982,7 +982,6 @@ libsss_ipa_la_LDFLAGS = \
 krb5_child_SOURCES = \
     src/providers/krb5/krb5_become_user.c \
     src/providers/krb5/krb5_child.c \
-    src/providers/child_common.c \
     src/providers/dp_pam_data_util.c \
     src/util/user_info_msg.c \
     src/util/sss_krb5.c \
@@ -994,6 +993,7 @@ krb5_child_CFLAGS = \
     $(KRB5_CFLAGS)
 krb5_child_LDADD = \
     libsss_debug.la \
+    libsss_child.la \
     $(TALLOC_LIBS) \
     $(TEVENT_LIBS) \
     $(POPT_LIBS) \
@@ -1002,7 +1002,6 @@ krb5_child_LDADD = \
 
 ldap_child_SOURCES = \
     src/providers/ldap/ldap_child.c \
-    src/providers/child_common.c \
     src/util/sss_krb5.c \
     src/util/util.c \
     src/util/signal.c
@@ -1012,6 +1011,7 @@ ldap_child_CFLAGS = \
     $(KRB5_CFLAGS)
 ldap_child_LDADD = \
     libsss_debug.la \
+    libsss_child.la \
     $(TALLOC_LIBS) \
     $(TEVENT_LIBS) \
     $(POPT_LIBS) \
diff --git a/src/providers/data_provider_be.c b/src/providers/data_provider_be.c
index 4910aa6fc50429bf2a6367ce9ffa90e5689d5c91..883b1ab4f7feb003243ccc57d893f35817ed88ad 100644
--- a/src/providers/data_provider_be.c
+++ b/src/providers/data_provider_be.c
@@ -42,7 +42,7 @@
 #include "sbus/sssd_dbus.h"
 #include "providers/dp_backend.h"
 #include "providers/fail_over.h"
-#include "providers/child_common.h"
+#include "util/child_common.h"
 #include "resolv/async_resolv.h"
 #include "monitor/monitor_interfaces.h"
 
diff --git a/src/providers/dp_backend.h b/src/providers/dp_backend.h
index 0c24b82c9687b75a69f1559a16647fb0fb86c00d..89f86c9e693010b0f1a975be07c9eafe6ec50337 100644
--- a/src/providers/dp_backend.h
+++ b/src/providers/dp_backend.h
@@ -24,7 +24,7 @@
 
 #include "providers/data_provider.h"
 #include "providers/fail_over.h"
-#include "providers/child_common.h"
+#include "util/child_common.h"
 #include "db/sysdb.h"
 
 /* a special token, if used in place of the hostname, denotes that real
diff --git a/src/providers/ipa/ipa_dyndns.c b/src/providers/ipa/ipa_dyndns.c
index e579e1d9ca28b6e48523b7dad316e46075753159..60bc6ec0c6704c45e516fdbf3b33abe85d94a2fa 100644
--- a/src/providers/ipa/ipa_dyndns.c
+++ b/src/providers/ipa/ipa_dyndns.c
@@ -33,7 +33,7 @@
 #include "confdb/confdb.h"
 #include "providers/ipa/ipa_common.h"
 #include "providers/ipa/ipa_dyndns.h"
-#include "providers/child_common.h"
+#include "util/child_common.h"
 #include "providers/data_provider.h"
 #include "providers/ldap/ldap_common.h"
 #include "providers/ldap/sdap_async_private.h"
diff --git a/src/providers/ipa/ipa_init.c b/src/providers/ipa/ipa_init.c
index 57b4180cc25ad044b3c7dd2c61afc8c34f0eb4b8..9acee7bf241ba6dd7fea1b45aa589899945ea6c6 100644
--- a/src/providers/ipa/ipa_init.c
+++ b/src/providers/ipa/ipa_init.c
@@ -27,7 +27,7 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 
-#include "providers/child_common.h"
+#include "util/child_common.h"
 #include "providers/ipa/ipa_common.h"
 #include "providers/krb5/krb5_auth.h"
 #include "providers/ipa/ipa_id.h"
diff --git a/src/providers/krb5/krb5_auth.c b/src/providers/krb5/krb5_auth.c
index f177be5131261defe119f24247dfc6ccc02c633c..6aaf7fbefd47609c926f6b5d8ea492295d4f090f 100644
--- a/src/providers/krb5/krb5_auth.c
+++ b/src/providers/krb5/krb5_auth.c
@@ -35,7 +35,7 @@
 #include "util/util.h"
 #include "util/find_uid.h"
 #include "db/sysdb.h"
-#include "providers/child_common.h"
+#include "util/child_common.h"
 #include "providers/krb5/krb5_auth.h"
 #include "providers/krb5/krb5_utils.h"
 
diff --git a/src/providers/krb5/krb5_auth.h b/src/providers/krb5/krb5_auth.h
index 0d6318d1231bbb7f8379a86bb908728d32566785..89b77d3663d2aec8dbf73178ca6827213f94d89d 100644
--- a/src/providers/krb5/krb5_auth.h
+++ b/src/providers/krb5/krb5_auth.h
@@ -30,7 +30,7 @@
 
 #include "util/sss_krb5.h"
 #include "providers/dp_backend.h"
-#include "providers/child_common.h"
+#include "util/child_common.h"
 #include "providers/krb5/krb5_common.h"
 
 #define CCACHE_ENV_NAME "KRB5CCNAME"
diff --git a/src/providers/krb5/krb5_child.c b/src/providers/krb5/krb5_child.c
index fe87210947cb7b826d3c9b18beb9fbf96ef5a734..01690cf4a1887b7e821853fd5b1983652d6ba6ef 100644
--- a/src/providers/krb5/krb5_child.c
+++ b/src/providers/krb5/krb5_child.c
@@ -32,7 +32,7 @@
 #include "util/util.h"
 #include "util/sss_krb5.h"
 #include "util/user_info_msg.h"
-#include "providers/child_common.h"
+#include "util/child_common.h"
 #include "providers/dp_backend.h"
 #include "providers/krb5/krb5_auth.h"
 #include "providers/krb5/krb5_utils.h"
diff --git a/src/providers/krb5/krb5_child_handler.c b/src/providers/krb5/krb5_child_handler.c
index bafa0bbf27cfc04fb59941d855d078819845c36d..990a9eccbb433147bebb324c65ce5c441aeb7f73 100644
--- a/src/providers/krb5/krb5_child_handler.c
+++ b/src/providers/krb5/krb5_child_handler.c
@@ -23,7 +23,7 @@
 */
 
 #include "util/util.h"
-#include "providers/child_common.h"
+#include "util/child_common.h"
 #include "providers/krb5/krb5_common.h"
 #include "providers/krb5/krb5_auth.h"
 #include "src/providers/krb5/krb5_utils.h"
diff --git a/src/providers/krb5/krb5_init.c b/src/providers/krb5/krb5_init.c
index 6176dd187e90e7e3aa72d8fe70ba77c02438c55c..3c39d847e0b22a03ca95182e64c1b7b46a17bd90 100644
--- a/src/providers/krb5/krb5_init.c
+++ b/src/providers/krb5/krb5_init.c
@@ -26,7 +26,7 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include <sys/stat.h>
-#include "providers/child_common.h"
+#include "util/child_common.h"
 #include "providers/krb5/krb5_auth.h"
 #include "providers/krb5/krb5_common.h"
 
diff --git a/src/providers/ldap/ldap_child.c b/src/providers/ldap/ldap_child.c
index 02c7e55737ad743ba05e7138cf1e5554939dfdc0..160cc1ce464f4ff7ec1cfd9fc4eb31e2ddf4c5fe 100644
--- a/src/providers/ldap/ldap_child.c
+++ b/src/providers/ldap/ldap_child.c
@@ -31,7 +31,7 @@
 
 #include "util/util.h"
 #include "util/sss_krb5.h"
-#include "providers/child_common.h"
+#include "util/child_common.h"
 #include "providers/dp_backend.h"
 
 static krb5_context krb5_error_ctx;
diff --git a/src/providers/ldap/ldap_init.c b/src/providers/ldap/ldap_init.c
index b4d844decce040c92f1102b474ce2a03fa092c85..e668e313d0e83bce7e5c656a553998ede03fb4c6 100644
--- a/src/providers/ldap/ldap_init.c
+++ b/src/providers/ldap/ldap_init.c
@@ -22,7 +22,7 @@
     along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#include "providers/child_common.h"
+#include "util/child_common.h"
 #include "providers/ldap/ldap_common.h"
 #include "providers/ldap/sdap_async_private.h"
 #include "providers/ldap/sdap_access.h"
diff --git a/src/providers/ldap/sdap_child_helpers.c b/src/providers/ldap/sdap_child_helpers.c
index 5990fc3ac729b46cbc8ca96290b9827039a11968..704c89ec3043a43b71ef47a900c5220a7aa22149 100644
--- a/src/providers/ldap/sdap_child_helpers.c
+++ b/src/providers/ldap/sdap_child_helpers.c
@@ -32,7 +32,7 @@
 #include "util/sss_krb5.h"
 #include "providers/ldap/ldap_common.h"
 #include "providers/ldap/sdap_async_private.h"
-#include "providers/child_common.h"
+#include "util/child_common.h"
 
 #ifndef SSSD_LIBEXEC_PATH
 #error "SSSD_LIBEXEC_PATH not defined"
diff --git a/src/providers/child_common.c b/src/util/child_common.c
similarity index 99%
rename from src/providers/child_common.c
rename to src/util/child_common.c
index a130d6bb7a30d277320870dffd7721a5d7ba5407..0db1a1d261bd67f9c99ded34959db977a364ca0e 100644
--- a/src/providers/child_common.c
+++ b/src/util/child_common.c
@@ -31,7 +31,7 @@
 #include "util/util.h"
 #include "util/find_uid.h"
 #include "db/sysdb.h"
-#include "providers/child_common.h"
+#include "util/child_common.h"
 
 struct sss_sigchild_ctx {
     struct tevent_context *ev;
diff --git a/src/providers/child_common.h b/src/util/child_common.h
similarity index 100%
rename from src/providers/child_common.h
rename to src/util/child_common.h
-- 
1.7.7.4

