>From 20dc1d083dce6d31bbfad4063b530c62dc4bf11d Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <jhrozek@redhat.com>
Date: Wed, 23 Sep 2009 12:00:09 +0200
Subject: [PATCH] Remove provider=files

Remove this provider type, as well as any references in the docs and
examples to the "LEGACYLOCAL" migration domain.
---
 server/examples/sssd.conf           |   17 ----------
 server/examples/sssdproxylocal      |    5 ---
 server/man/sssd.conf.5.xml          |   12 +-------
 server/providers/data_provider_be.c |   56 -----------------------------------
 4 files changed, 1 insertions(+), 89 deletions(-)
 delete mode 100644 server/examples/sssdproxylocal

diff --git a/server/examples/sssd.conf b/server/examples/sssd.conf
index 4b04c3d..894dc75 100644
--- a/server/examples/sssd.conf
+++ b/server/examples/sssd.conf
@@ -42,23 +42,6 @@ description = Domains served by SSSD
 # Then add the list of domains (in the order you want them to be
 # queried in the 'domains" attribute above and uncomment it
 
-# Example LOCAL domain that proxies to /etc/passwd and /etc/group files
-# This configuration is meant mostly as a migration path to be able to store
-# additional information about users while still keeping /etc/passwd
-# authoritative.
-
-; [domains/LOCAL]
-; description = LOCAL migration domain
-; enumerate = true
-; minId = 500
-;
-; provider = files
-
-# optionally a file named sssdproxylocal can be place in pam.d configured to
-# check pam_unix only and pam_sss can be used in the normal pam stack
-; auth-module = proxy
-; pam-target = sssdproxylocal
-
 # Example LOCAL domain that stores all users natively in the SSSD internal
 # directory. These local users and groups are not visibile in /etc/passwd, it
 # now contains only root and system accounts.
diff --git a/server/examples/sssdproxylocal b/server/examples/sssdproxylocal
deleted file mode 100644
index 063dbff..0000000
--- a/server/examples/sssdproxylocal
+++ /dev/null
@@ -1,5 +0,0 @@
-#%PAM-1.0
-auth        required      pam_unix.so
-
-account     required      pam_unix.so
-
diff --git a/server/man/sssd.conf.5.xml b/server/man/sssd.conf.5.xml
index edf3089..d1f859c 100644
--- a/server/man/sssd.conf.5.xml
+++ b/server/man/sssd.conf.5.xml
@@ -516,9 +516,6 @@
                             Supported backends:
                         </para>
                         <para>
-                            files: traditional UNIX files (<filename>/etc/passwd</filename>)
-                        </para>
-                        <para>
                             proxy: Support a legacy NSS provider
                         </para>
                         <para>
@@ -637,7 +634,7 @@ description = Service Monitor Configuration
 
 [domains]
 description = Domains served by SSSD
-domains = LOCAL,FILES
+domains = LOCAL
 
 [domains/LOCAL]
 description = LOCAL Users domain
@@ -647,13 +644,6 @@ maxId = 30000
 legacy = FALSE
 magicPrivateGroups = TRUE
 provider = local
-
-[domains/FILES]
-description = Users stored in UNIX files
-enumerate = TRUE
-minId = 500
-maxId = 4999
-provider = files
 </programlisting>
         </para>
     </refsect1>
diff --git a/server/providers/data_provider_be.c b/server/providers/data_provider_be.c
index b8630e6..7e951d5 100644
--- a/server/providers/data_provider_be.c
+++ b/server/providers/data_provider_be.c
@@ -817,56 +817,6 @@ done:
     return ret;
 }
 
-/* Some providers are just aliases for more complicated settings,
- * rewrite the alias into the actual settings */
-static int be_rewrite(struct be_ctx *ctx)
-{
-    int ret;
-    const char *val[2];
-    val[1] = NULL;
-    char **get_values = NULL;
-
-    /* "files" is a special case that means:
-     *  provider = proxy
-     *  libName  = files
-     */
-    ret = confdb_get_param(ctx->cdb, ctx, ctx->conf_path, "provider",
-                           &get_values);
-    if (ret != EOK) {
-        DEBUG(1, ("Failed to read provider from confdb.\n"));
-        return ret;
-    }
-    if (get_values[0] == NULL) {
-        DEBUG(1, ("Missing provider.\n"));
-        return EINVAL;
-    }
-
-    if (strcasecmp(get_values[0], "files") == 0) {
-        DEBUG(5, ("Rewriting provider %s\n", get_values[0]));
-        talloc_zfree(get_values);
-
-        val[0] = "proxy";
-        ret = confdb_add_param(ctx->cdb, true,
-                               ctx->conf_path,
-                               "provider",
-                               val);
-        if (ret) {
-            return ret;
-        }
-
-        val[0] = "files";
-        ret = confdb_add_param(ctx->cdb, true,
-                               ctx->conf_path,
-                               "libName",
-                               val);
-        if (ret) {
-            return ret;
-        }
-    }
-
-    return EOK;
-}
-
 int be_process_init(TALLOC_CTX *mem_ctx,
                     const char *be_domain,
                     struct tevent_context *ev,
@@ -913,12 +863,6 @@ int be_process_init(TALLOC_CTX *mem_ctx,
         return ret;
     }
 
-    ret = be_rewrite(ctx);
-    if (ret != EOK) {
-        SYSLOG_ERROR("error rewriting provider types\n");
-        return ret;
-    }
-
     ret = load_backend_module(ctx, BET_ID,
                               &ctx->bet_info[BET_ID].bet_ops,
                               &ctx->bet_info[BET_ID].pvt_bet_data);
-- 
1.6.2.5

