summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2007-12-29 12:52:09 +0100
committerMichael Adam <obnox@samba.org>2007-12-29 12:52:09 +0100
commit2a642a6e2b42c2b111870f95fe6dd38e875766f1 (patch)
treef5c2dd575dab3775daf56dadaa1ecb3a2b1eeb28 /source3/utils
parentf8c39cbb7b3e4df3c07735575bc5f31717b22f66 (diff)
downloadsamba-2a642a6e2b42c2b111870f95fe6dd38e875766f1.tar.gz
samba-2a642a6e2b42c2b111870f95fe6dd38e875766f1.tar.bz2
samba-2a642a6e2b42c2b111870f95fe6dd38e875766f1.zip
Move functionality of net_conf_listshares() to libnet_conf.c
into new function libnet_smbconf_getshares(). Michael (This used to be commit 306c7e4d9cecac4c2c0ea1172bd585c3c17d4541)
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net_conf.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/source3/utils/net_conf.c b/source3/utils/net_conf.c
index 9a7c8c9097..5c0d6c6376 100644
--- a/source3/utils/net_conf.c
+++ b/source3/utils/net_conf.c
@@ -459,9 +459,8 @@ static int net_conf_listshares(int argc, const char **argv)
{
WERROR werr = WERR_OK;
int ret = -1;
- struct registry_key *key;
- uint32 idx = 0;
- char *subkey_name = NULL;
+ uint32_t count, num_shares = 0;
+ char **share_names = NULL;
TALLOC_CTX *ctx;
ctx = talloc_init("listshares");
@@ -471,23 +470,14 @@ static int net_conf_listshares(int argc, const char **argv)
goto done;
}
- werr = libnet_smbconf_reg_open_basepath(ctx, SEC_RIGHTS_ENUM_SUBKEYS,
- &key);
+ werr = libnet_smbconf_getshares(ctx, &num_shares, &share_names);
if (!W_ERROR_IS_OK(werr)) {
goto done;
}
- for (idx = 0;
- W_ERROR_IS_OK(werr = reg_enumkey(ctx, key, idx,
- &subkey_name, NULL));
- idx++)
+ for (count = 0; count <= num_shares; count++)
{
- d_printf("%s\n", subkey_name);
- }
- if (! W_ERROR_EQUAL(WERR_NO_MORE_ITEMS, werr)) {
- d_fprintf(stderr, "Error enumerating subkeys: %s\n",
- dos_errstr(werr));
- goto done;
+ d_printf("%s\n", share_names[count]);
}
ret = 0;