Speed up "net conf list"
authorVolker Lendecke <vl@samba.org>
Sat, 21 Feb 2009 16:01:58 +0000 (17:01 +0100)
committerMichael Adam <obnox@samba.org>
Thu, 19 Mar 2009 17:03:54 +0000 (18:03 +0100)
With 1000 shares in the registry, this changed the time of "net conf list" from
1.1 seconds to .6 seconds.

Signed-off-by: Michael Adam <obnox@samba.org>
source/lib/smbconf/smbconf.c
source/lib/smbconf/smbconf_reg.c

index 2d4f635f85407b6c19fa264d687f9b0ec8dd8d71..f57ca9052069e2a206708294bd76b4d1446c05e5 100644 (file)
@@ -203,10 +203,6 @@ WERROR smbconf_get_share(struct smbconf_ctx *ctx,
                         const char *servicename,
                         struct smbconf_service **service)
 {
-       if (!smbconf_share_exists(ctx, servicename)) {
-               return WERR_NO_SUCH_SERVICE;
-       }
-
        return ctx->ops->get_share(ctx, mem_ctx, servicename, service);
 }
 
index 0b5e45de8be8b83e1b988383c6bb59cace760a2a..0a64e9a8bc8e769fb73b7d844138e6279c27e90a 100644 (file)
@@ -896,6 +896,9 @@ static WERROR smbconf_reg_get_share(struct smbconf_ctx *ctx,
        werr = smbconf_reg_open_service_key(tmp_ctx, ctx, servicename,
                                            REG_KEY_READ, &key);
        if (!W_ERROR_IS_OK(werr)) {
+               if (W_ERROR_EQUAL(werr, WERR_BADFILE)) {
+                       werr = WERR_NO_SUCH_SERVICE;
+               }
                goto done;
        }