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>
Sun, 22 Feb 2009 22:15:55 +0000 (23:15 +0100)
With 1000 shares in the registry, this changed the time of "net conf list" from
1.1 seconds to .6 seconds.

source/lib/smbconf/smbconf.c
source/lib/smbconf/smbconf_reg.c

index 396feab02d5c3d57e8f78613b637733a5bae623b..5d5049cede9e1a473bed92d86fe8468ffb53184a 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 59ae55f94ba8dc019fea516941975d68f37ace62..a526a685821d8eb31b08748d4232812aacb0af76 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;
        }